Add button for resync wallet

This commit is contained in:
benthecarman
2023-06-12 16:29:45 -05:00
committed by Paul Miller
parent c1b024baf6
commit 10e569654d
4 changed files with 35 additions and 5 deletions

View File

@@ -13,6 +13,7 @@ import { Network } from "~/logic/mutinyWalletSetup";
import { ExternalLink } from "./layout/ExternalLink";
import { Logs } from "./Logs";
import { Restart } from "./Restart";
import { ResyncOnchain } from "./ResyncOnchain";
import { MiniStringShower } from "./DetailsModal";
// TODO: hopefully I don't have to maintain this type forever but I don't know how to pass it around otherwise
@@ -437,6 +438,8 @@ export default function KitchenSink() {
<Hr />
<LnUrlAuth />
<Hr />
<ResyncOnchain />
<Hr />
<Restart />
<Hr />
<ImportExport />

View File

@@ -0,0 +1,27 @@
import {Button, InnerCard, NiceP, VStack} from "~/components/layout";
import {useMegaStore} from "~/state/megaStore";
export function ResyncOnchain() {
const [state, _] = useMegaStore();
async function reset() {
try {
await state.mutiny_wallet?.reset_onchain_tracker();
} catch (e) {
console.error(e);
}
}
return (
<InnerCard>
<VStack>
<NiceP>
On-chain balance seems incorrect? Try re-syncing the on-chain wallet.
</NiceP>
<Button intent="red" onClick={reset}>
Resync wallet
</Button>
</VStack>
</InnerCard>
);
}