Skip to content

Commit

Permalink
Bring back reset router
Browse files Browse the repository at this point in the history
  • Loading branch information
benthecarman authored and futurepaul committed Jul 6, 2023
1 parent 68bd5f8 commit 8fbda88
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/components/KitchenSink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -428,6 +429,8 @@ export default function KitchenSink() {
<Hr />
<ResyncOnchain />
<Hr />
<ResetRouter />
<Hr />
<Restart />
<Hr />
</>
Expand Down
27 changes: 27 additions & 0 deletions src/components/ResetRouter.tsx
Original file line number Diff line number Diff line change
@@ -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>
);
}

0 comments on commit 8fbda88

Please sign in to comment.