From cfb1fa0ca0504fbfe56d80cbfc942794e03e1c38 Mon Sep 17 00:00:00 2001
From: callebtc <93376500+callebtc@users.noreply.github.com>
Date: Fri, 16 Aug 2024 14:10:24 +0200
Subject: [PATCH] option to nuke wallet
---
src/components/SettingsView.vue | 54 +++++++++++++++++++++++++++++++++
1 file changed, 54 insertions(+)
diff --git a/src/components/SettingsView.vue b/src/components/SettingsView.vue
index d37920f4..43400252 100644
--- a/src/components/SettingsView.vue
+++ b/src/components/SettingsView.vue
@@ -763,6 +763,51 @@
+
+
+
+
+ Reset wallet data
+
+ Reset your wallet data. Warning: This will delete
+ everything! Make sure you create a backup first.
+
+
+
+ Are you sure you want to delete your wallet data?
+ Cancel
+ Delete wallet
+
+
+
@@ -841,6 +886,7 @@ export default defineComponent({
discoveringMints: false,
hideMnemonic: true,
confirmMnemonic: false,
+ confirmNuke: false,
nip46Token: "",
nostrPrivateKey: "",
nip07SignerAvailable: false,
@@ -944,6 +990,7 @@ export default defineComponent({
"removeMint",
"activateMintUrl",
"updateMint",
+ "restoreFromBackup",
]),
...mapActions(useWalletStore, [
"newMnemonic",
@@ -1072,6 +1119,13 @@ export default defineComponent({
await this.resetNip46Signer();
await this.generateNPCConnection();
},
+ nukeWallet: async function () {
+ // create a backup just in case
+ await this.getLocalstorageToFile();
+ localStorage.clear();
+ this.$router.push("/");
+ this.$emit("close");
+ },
},
created: async function () {
this.nip07SignerAvailable = await this.checkNip07Signer();