From 14877f1a0c4fcd61a4ab6089640d1cce385c7bcf Mon Sep 17 00:00:00 2001 From: Roland Bewick Date: Wed, 12 Jun 2024 23:00:32 +0700 Subject: [PATCH] fix: update alby card state after linking account --- frontend/src/hooks/useLinkAccount.ts | 4 ++-- frontend/src/screens/apps/AppList.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/hooks/useLinkAccount.ts b/frontend/src/hooks/useLinkAccount.ts index 0c4902c84..3f774e63f 100644 --- a/frontend/src/hooks/useLinkAccount.ts +++ b/frontend/src/hooks/useLinkAccount.ts @@ -13,7 +13,7 @@ export enum LinkStatus { export function useLinkAccount() { const { data: csrf } = useCSRF(); - const { data: me } = useAlbyMe(); + const { data: me, mutate: reloadAlbyMe } = useAlbyMe(); const { data: nodeConnectionInfo } = useNodeConnectionInfo(); const [loading, setLoading] = useState(false); const [loadingLinkStatus, setLoadingLinkStatus] = useState(true); @@ -45,7 +45,7 @@ export function useLinkAccount() { "Content-Type": "application/json", }, }); - setLinkStatus(LinkStatus.ThisNode); + await reloadAlbyMe(); toast({ title: "Your Alby Hub has successfully been linked to your Alby Account", diff --git a/frontend/src/screens/apps/AppList.tsx b/frontend/src/screens/apps/AppList.tsx index d3529ba7e..6ae074c45 100644 --- a/frontend/src/screens/apps/AppList.tsx +++ b/frontend/src/screens/apps/AppList.tsx @@ -93,7 +93,7 @@ function AppList() { {loadingLinkStatus && } {!albyConnection || linkStatus === LinkStatus.SharedNode ? ( - + {!loading && } Link your Alby Account ) : linkStatus === LinkStatus.ThisNode ? (