code review: refactor
This commit is contained in:
parent
694120216a
commit
506cab6c82
|
@ -71,11 +71,10 @@ export function FeedAnswerCommentGroup(props: {
|
||||||
const scrollAndOpenReplyInput = useEvent(
|
const scrollAndOpenReplyInput = useEvent(
|
||||||
(comment?: Comment, answer?: Answer) => {
|
(comment?: Comment, answer?: Answer) => {
|
||||||
setReplyToUser(
|
setReplyToUser(
|
||||||
comment ?? answer
|
comment
|
||||||
? {
|
? { id: comment.userId, username: comment.userUsername }
|
||||||
id: comment?.userId ?? (answer as Answer).userId,
|
: answer
|
||||||
username: comment?.userUsername ?? (answer as Answer).username,
|
? { id: answer.userId, username: answer.username }
|
||||||
}
|
|
||||||
: undefined
|
: undefined
|
||||||
)
|
)
|
||||||
setShowReply(true)
|
setShowReply(true)
|
||||||
|
|
|
@ -302,7 +302,7 @@ const GroupMessage = memo(function GroupMessage_(props: {
|
||||||
const first = comments[0]
|
const first = comments[0]
|
||||||
const { id, userUsername, userName, userAvatarUrl, createdTime } = first
|
const { id, userUsername, userName, userAvatarUrl, createdTime } = first
|
||||||
|
|
||||||
const isCreatorsComment = user && comments[0].userId === user.id
|
const isCreatorsComment = user && first.userId === user.id
|
||||||
return (
|
return (
|
||||||
<Col
|
<Col
|
||||||
ref={setRef}
|
ref={setRef}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user