From 77312f3fb2831456072f46f26aa94be8a1c859af Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Sun, 29 Oct 2023 21:43:03 +0800 Subject: [PATCH] Use current instance for links on account info --- src/components/account-info.jsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/account-info.jsx b/src/components/account-info.jsx index 3e56205b..af098fd3 100644 --- a/src/components/account-info.jsx +++ b/src/components/account-info.jsx @@ -126,7 +126,7 @@ function AccountInfo({ const { masto } = api({ instance, }); - const { masto: currentMasto } = api(); + const { masto: currentMasto, instance: currentInstance } = api(); const [uiState, setUIState] = useState('default'); const isString = typeof account === 'string'; const [info, setInfo] = useState(isString ? null : account); @@ -137,8 +137,8 @@ function AccountInfo({ ); const sameCurrentInstance = useMemo( - () => instance === api().instance, - [instance], + () => instance === currentInstance, + [instance, currentInstance], ); useEffect(() => { @@ -534,7 +534,7 @@ function AccountInfo({ class="note" dir="auto" onClick={handleContentLinks({ - instance, + instance: currentInstance, })} dangerouslySetInnerHTML={{ __html: enhanceContent(note, { emojis }),