fix: 修复评论删除问题
This commit is contained in:
@@ -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 (
|
||||
<View
|
||||
@@ -229,7 +229,7 @@ function CommentItem(props: {
|
||||
<Text>{getRelativeDay(comment.create_time)}</Text>
|
||||
</View>
|
||||
<View className={styles.location}>
|
||||
<Text>上海</Text>
|
||||
<Text>{comment.user.province}</Text>
|
||||
</View>
|
||||
<View
|
||||
className={styles.reply}
|
||||
@@ -243,18 +243,19 @@ function CommentItem(props: {
|
||||
>
|
||||
<Text>回复</Text>
|
||||
</View>
|
||||
{isGamePublisher || isCommentPublisher}
|
||||
<View
|
||||
className={styles.delete}
|
||||
onClick={() =>
|
||||
handleDelete({
|
||||
parent_id: comment.parent_id,
|
||||
id: comment.id,
|
||||
})
|
||||
}
|
||||
>
|
||||
<Text>删除</Text>
|
||||
</View>
|
||||
{(isGamePublisher || isCommentPublisher) && (
|
||||
<View
|
||||
className={styles.delete}
|
||||
onClick={() =>
|
||||
handleDelete({
|
||||
parent_id: comment.parent_id,
|
||||
id: comment.id,
|
||||
})
|
||||
}
|
||||
>
|
||||
<Text>删除</Text>
|
||||
</View>
|
||||
)}
|
||||
</View>
|
||||
</View>
|
||||
{!isReplyComment(comment) &&
|
||||
|
||||
@@ -10,6 +10,7 @@ export interface UserInfo {
|
||||
id: number
|
||||
nickname: string
|
||||
avatar_url: string
|
||||
province: string
|
||||
}
|
||||
|
||||
export type BaseComment<T = {}> = {
|
||||
|
||||
Reference in New Issue
Block a user