diff --git a/src/components/Comments/index.tsx b/src/components/Comments/index.tsx index 197e4b5..67c6c39 100644 --- a/src/components/Comments/index.tsx +++ b/src/components/Comments/index.tsx @@ -181,7 +181,7 @@ function CommentItem(props: { blink_id, } = props; const currentUserInfo = useUserInfo(); - const isGamePublisher = publisher_id === comment.user.id; + const isGamePublisher = publisher_id === currentUserInfo.id; const isCommentPublisher = currentUserInfo.id === comment.user.id; return ( {getRelativeDay(comment.create_time)} - 上海 + {comment.user.province} 回复 - {isGamePublisher || isCommentPublisher} - - handleDelete({ - parent_id: comment.parent_id, - id: comment.id, - }) - } - > - 删除 - + {(isGamePublisher || isCommentPublisher) && ( + + handleDelete({ + parent_id: comment.parent_id, + id: comment.id, + }) + } + > + 删除 + + )} {!isReplyComment(comment) && diff --git a/src/services/commentServices.ts b/src/services/commentServices.ts index 1c89fde..474107a 100644 --- a/src/services/commentServices.ts +++ b/src/services/commentServices.ts @@ -10,6 +10,7 @@ export interface UserInfo { id: number nickname: string avatar_url: string + province: string } export type BaseComment = {