Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

option to nuke wallet #219

Merged
merged 1 commit into from
Aug 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions src/components/SettingsView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,51 @@
</row>
</q-item-section>
</q-item>
<q-item>
<q-item-section>
<row>
<q-btn
v-if="!confirmNuke"
dense
flat
outline
click
@click="confirmNuke = !confirmNuke"
>
Reset wallet data
</q-btn></row
><row v-if="!confirmNuke">
<q-item-label class="q-px-sm" caption
>Reset your wallet data. Warning: This will delete
everything! Make sure you create a backup first.
</q-item-label>
</row>
<row v-if="confirmNuke">
<span
>Are you sure you want to delete your wallet data?</span
>
<q-btn
flat
dense
class="q-ml-sm"
color="warning"
@click="confirmNuke = false"
>Cancel</q-btn
>
<q-btn
flat
dense
class="q-ml-sm"
color="secondary"
@click="
confirmNuke = false;
nukeWallet();
"
>Delete wallet</q-btn
>
</row>
</q-item-section>
</q-item>
<q-item>
<q-item-section>
<row>
Expand Down Expand Up @@ -841,6 +886,7 @@ export default defineComponent({
discoveringMints: false,
hideMnemonic: true,
confirmMnemonic: false,
confirmNuke: false,
nip46Token: "",
nostrPrivateKey: "",
nip07SignerAvailable: false,
Expand Down Expand Up @@ -944,6 +990,7 @@ export default defineComponent({
"removeMint",
"activateMintUrl",
"updateMint",
"restoreFromBackup",
]),
...mapActions(useWalletStore, [
"newMnemonic",
Expand Down Expand Up @@ -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();
Expand Down
Loading