fix: 修复评论删除问题

This commit is contained in:
2025-10-14 15:12:04 +08:00
parent d2e051f93a
commit 56fd71f266
2 changed files with 16 additions and 14 deletions

View File

@@ -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) &&

View File

@@ -10,6 +10,7 @@ export interface UserInfo {
id: number
nickname: string
avatar_url: string
province: string
}
export type BaseComment<T = {}> = {