Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

Commit

Permalink
fix: update alby card state after linking account
Browse files Browse the repository at this point in the history
  • Loading branch information
rolznz committed Jun 12, 2024
1 parent 3cc5581 commit 14877f1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions frontend/src/hooks/useLinkAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/screens/apps/AppList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function AppList() {
{loadingLinkStatus && <Loading />}
{!albyConnection || linkStatus === LinkStatus.SharedNode ? (
<LoadingButton onClick={linkAccount} loading={loading}>
<Link2Icon className="w-4 h-4 mr-2" />
{!loading && <Link2Icon className="w-4 h-4 mr-2" />}
Link your Alby Account
</LoadingButton>
) : linkStatus === LinkStatus.ThisNode ? (
Expand Down

0 comments on commit 14877f1

Please sign in to comment.