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