From 54e2f2a589624066e0e6e8f9b09420a6b3b8898a Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Sat, 11 Mar 2023 15:14:59 +0800 Subject: [PATCH] Fix clicking on another account in account sheet not working --- src/components/account-info.jsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/account-info.jsx b/src/components/account-info.jsx index 8c84ce4e..163b82ac 100644 --- a/src/components/account-info.jsx +++ b/src/components/account-info.jsx @@ -28,7 +28,10 @@ function AccountInfo({ const [info, setInfo] = useState(isString ? null : account); useEffect(() => { - if (!isString) return; + if (!isString) { + setInfo(account); + return; + } setUIState('loading'); (async () => { try { @@ -41,7 +44,7 @@ function AccountInfo({ setUIState('error'); } })(); - }, [isString, fetchAccount]); + }, [isString, account, fetchAccount]); const { acct,