From 4b304ead346d5bc408a58688304b99162e7054f5 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Fri, 23 Apr 2021 11:49:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=AD=E5=BF=83=E5=85=B3?= =?UTF-8?q?=E6=B3=A8-=E5=85=B3=E6=B3=A8=E6=88=96=E8=80=85=E5=8F=96?= =?UTF-8?q?=E6=B6=88=E5=85=B3=E6=B3=A8=E6=9C=AA=E6=9B=B4=E6=96=B0=E7=8A=B6?= =?UTF-8?q?=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/UsersList/focus_button.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/forge/UsersList/focus_button.js b/src/forge/UsersList/focus_button.js index 192d4008..0d099fd6 100644 --- a/src/forge/UsersList/focus_button.js +++ b/src/forge/UsersList/focus_button.js @@ -5,6 +5,7 @@ import "./list.css"; function FocusButton({is_watch , fontClass, starText, is_block , id , successFunc}){ const [ isSpin , setIsSpin ] = useState(false); + const [ watchFlag , setWatchFlag ] = useState(is_watch); // 关注和取消关注 function focusFunc(flag){ setIsSpin(true); @@ -18,6 +19,7 @@ function FocusButton({is_watch , fontClass, starText, is_block , id , successFun }).then((result) => { if (result && result.data.status === 0) { successFunc && successFunc(); + setWatchFlag(!watchFlag); } setIsSpin(false); }) @@ -25,8 +27,8 @@ function FocusButton({is_watch , fontClass, starText, is_block , id , successFun }; return ( -