Skip to content
This repository was archived by the owner on Apr 21, 2025. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/components/KitchenSink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
ResetRouter,
Restart,
ResyncOnchain,
ScanFederation,
showToast,
SimpleErrorDisplay,
ToggleHodl,
Expand Down Expand Up @@ -574,6 +575,7 @@ export function KitchenSink() {
<ToggleHodl />
<Hr />
<ResyncOnchain />
<ScanFederation />
<Hr />
<ResetRouter />
<Hr />
Expand Down
27 changes: 27 additions & 0 deletions src/components/ScanFederation.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { Button, InnerCard, NiceP, VStack } from "~/components";
import { useI18n } from "~/i18n/context";
import { useMegaStore } from "~/state/megaStore";

export function ScanFederation() {
const i18n = useI18n();
const [state, _] = useMegaStore();

async function scan() {
try {
await state.mutiny_wallet?.recover_federation_backups();
} catch (e) {
console.error(e);
}
}

return (
<InnerCard>
<VStack>
<NiceP>{i18n.t("error.scan_federation.incorrect_balance")}</NiceP>
<Button intent="red" onClick={scan}>
{i18n.t("error.scan_federation.scan")}
</Button>
</VStack>
</InnerCard>
);
}
1 change: 1 addition & 0 deletions src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export * from "./Reload";
export * from "./ResetRouter";
export * from "./Restart";
export * from "./ResyncOnchain";
export * from "./ScanFederation";
export * from "./SeedWords";
export * from "./SetupErrorDisplay";
export * from "./ShareCard";
Expand Down
5 changes: 5 additions & 0 deletions src/i18n/en/translations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,11 @@ export default {
"On-chain balance seems incorrect? Try re-syncing the on-chain wallet.",
resync_wallet: "Resync wallet"
},
scan_federation: {
incorrect_balance:
"Federation balance seems incorrect? Try scanning the federations.",
scan: "Scan federations"
},
on_boot: {
existing_tab: {
title: "Multiple tabs detected",
Expand Down