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