From 82baeee0bbfcf92b7262ee4bc06b00cf3cc423a0 Mon Sep 17 00:00:00 2001 From: Arnab Chakraborty <11457760+Rocky43007@users.noreply.github.com> Date: Sat, 22 Jun 2024 04:41:31 +0530 Subject: [PATCH] I think I fixed it? --- .../settings/client/SpacedriveAccount.tsx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/interface/app/$libraryId/settings/client/SpacedriveAccount.tsx b/interface/app/$libraryId/settings/client/SpacedriveAccount.tsx index e05688945..618a13ae6 100644 --- a/interface/app/$libraryId/settings/client/SpacedriveAccount.tsx +++ b/interface/app/$libraryId/settings/client/SpacedriveAccount.tsx @@ -4,16 +4,22 @@ import { AuthRequiredOverlay } from '~/components/AuthRequiredOverlay'; import { useLocale } from '~/hooks'; export function SpacedriveAccount() { + const authState = auth.useStateSnapshot(); + const me = useBridgeQuery(['auth.me'], { retry: false }); + + if (authState.status === 'loggedIn') { + me.refetch(); + } + return ( - + ); } -function Account() { - const me = useBridgeQuery(['auth.me'], { retry: false }); +function Account(props: { data: { id: string; email: string } }) { const { t } = useLocale(); return ( @@ -25,7 +31,7 @@ function Account() {
- {t('logged_in_as', { email: me.data?.email })} + {t('logged_in_as', { email: props.data.email })} ); }