chore: clean up

This commit is contained in:
reya
2024-08-28 08:48:17 +07:00
parent f6eb5eea44
commit d128af1db8
27 changed files with 311 additions and 741 deletions
@@ -1,4 +1,4 @@
import { NostrAccount } from "@/system";
import { commands } from "@/commands.gen";
import { createLazyFileRoute, redirect } from "@tanstack/react-router";
export const Route = createLazyFileRoute("/$account/_settings/wallet")({
@@ -10,10 +10,14 @@ function Screen() {
const { balance } = Route.useRouteContext();
const disconnect = async () => {
window.localStorage.removeItem("bc:config");
await NostrAccount.removeWallet();
const res = await commands.removeWallet();
return redirect({ to: "/$account/bitcoin-connect", params: { account } });
if (res.status === "ok") {
window.localStorage.removeItem("bc:config");
return redirect({ to: "/$account/bitcoin-connect", params: { account } });
} else {
throw new Error(res.error);
}
};
return (