Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scan federation balance #857

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
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();

Check failure on line 11 in src/components/ScanFederation.tsx

View workflow job for this annotation

GitHub Actions / Build APK

Property 'recover_federation_backups' does not exist on type 'MutinyWallet'.

Check failure on line 11 in src/components/ScanFederation.tsx

View workflow job for this annotation

GitHub Actions / Build iOS

Property 'recover_federation_backups' does not exist on type 'MutinyWallet'.
} 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
Loading