From 888e873a7c00bb481c9c99305610b6401c10a77a Mon Sep 17 00:00:00 2001 From: shuai Date: Mon, 6 Mar 2023 12:20:57 +0800 Subject: [PATCH] fix: answer the author's conditional judgement --- ui/src/pages/Questions/Detail/index.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ui/src/pages/Questions/Detail/index.tsx b/ui/src/pages/Questions/Detail/index.tsx index 87c27caf..610e3dcd 100644 --- a/ui/src/pages/Questions/Detail/index.tsx +++ b/ui/src/pages/Questions/Detail/index.tsx @@ -80,7 +80,10 @@ const Index = () => { res.list = res.list?.filter((v) => { // delete answers pnly show to author and admin and has searchparams aid if (v.status === 10) { - if ((isAuthor || isAdmin) && aid === v.id) { + if ( + (v?.user_info.username === userInfo?.username || isAdmin) && + aid === v.id + ) { return v; } return null;