mirror of
https://github.com/aljazceru/mutiny-web.git
synced 2026-01-04 14:54:24 +01:00
Add button for resync wallet
This commit is contained in:
committed by
Paul Miller
parent
c1b024baf6
commit
10e569654d
@@ -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 />
|
||||
|
||||
27
src/components/ResyncOnchain.tsx
Normal file
27
src/components/ResyncOnchain.tsx
Normal 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>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user