Skip to content

Commit

Permalink
can't scan a federation when in a federation
Browse files Browse the repository at this point in the history
  • Loading branch information
futurepaul authored and benthecarman committed Apr 3, 2024
1 parent ea5bb01 commit e498859
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 7 deletions.
3 changes: 2 additions & 1 deletion public/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,8 @@
"discover": "Discover Federations",
"manual": "Invite Code",
"created_at": "Created At",
"recommended_by": "Recommended By"
"recommended_by": "Recommended By",
"already_in_fed": "You're already in a federation!"
},
"gift": {
"give_sats_link": "Give sats as a gift",
Expand Down
29 changes: 23 additions & 6 deletions src/routes/settings/ManageFederations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import {
MutinyWalletGuard,
NavBar,
NiceP,
showToast,
TextField,
VStack
} from "~/components";
Expand Down Expand Up @@ -464,20 +465,36 @@ export function ManageFederations() {
}
});

const [params, setParams] = useSearchParams();

onMount(() => {
if (params.fedimint_invite && state.federations?.length) {
showToast(
new Error(i18n.t("settings.manage_federations.already_in_fed"))
);

// Clear the search params
setParams({ fedimint_invite: undefined });
}
});

return (
<MutinyWalletGuard>
<DefaultMain>
<div class="flex items-center justify-between">
<BackLink
href="/profile"
title={i18n.t("profile.profile")}
showOnDesktop
/>
<A
class="rounded-lg p-2 hover:bg-white/5 active:bg-m-blue md:hidden"
href="/scanner"
>
<Scan />
</A>{" "}
<Show when={!state.federations?.length}>
<A
class="rounded-lg p-2 hover:bg-white/5 active:bg-m-blue"
href="/scanner"
>
<Scan />
</A>{" "}
</Show>
</div>
{/* <BackLink href="/settings" title={i18n.t("settings.header")} /> */}
<LargeHeader>
Expand Down

0 comments on commit e498859

Please sign in to comment.