Bring back reset router

This commit is contained in:
benthecarman
2023-07-05 21:33:31 -05:00
committed by Paul Miller
parent 68bd5f8d3d
commit 8fbda8856f
2 changed files with 30 additions and 0 deletions

View File

@@ -19,6 +19,7 @@ import { Network } from "~/logic/mutinyWalletSetup";
import { ExternalLink } from "./layout/ExternalLink";
import { Restart } from "./Restart";
import { ResyncOnchain } from "./ResyncOnchain";
import { ResetRouter } from "./ResetRouter";
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
@@ -428,6 +429,8 @@ export default function KitchenSink() {
<Hr />
<ResyncOnchain />
<Hr />
<ResetRouter />
<Hr />
<Restart />
<Hr />
</>

View File

@@ -0,0 +1,27 @@
import { Button, InnerCard, NiceP, VStack } from "~/components/layout";
import { useMegaStore } from "~/state/megaStore";
export function ResetRouter() {
const [state, _] = useMegaStore();
async function reset() {
try {
await state.mutiny_wallet?.reset_router();
} catch (e) {
console.error(e);
}
}
return (
<InnerCard>
<VStack>
<NiceP>
Failing to make payments? Try resetting the lightning router.
</NiceP>
<Button intent="red" onClick={reset}>
Reset Router
</Button>
</VStack>
</InnerCard>
);
}