Skip to content

Commit

Permalink
fix: reset lock screen issue
Browse files Browse the repository at this point in the history
  • Loading branch information
kvhnuke committed Jan 19, 2024
1 parent c2ca03c commit 6e12049
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/extension/src/ui/action/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@
@update:active-networks="setActiveNetworks"
/>

<settings v-if="settingsShow" @close:popup="settingsShow = !settingsShow" />
<settings
v-if="settingsShow"
@close:popup="settingsShow = !settingsShow"
@action:lock="lockAction"
/>
<modal-rate v-if="rateShow" @close:popup="rateShow = !rateShow" />
<modal-new-version
v-if="updateShow"
Expand Down
5 changes: 5 additions & 0 deletions packages/extension/src/ui/action/views/reset-wallet/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ import BaseInput from "@action/components/base-input/index.vue";
import KeyRingBase from "@/libs/keyring/keyring";
import openOnboard from "@/libs/utils/open-onboard";
const emit = defineEmits<{
(e: "action:lock"): void;
}>();
const reset = ref("");
const isProcessing = ref(false);
Expand All @@ -63,6 +67,7 @@ const resetAction = async () => {
isProcessing.value = true;
const keyring = new KeyRingBase();
await keyring.reset();
emit("action:lock");
openOnboard();
};
</script>
Expand Down
1 change: 1 addition & 0 deletions packages/extension/src/ui/action/views/settings/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
/>
<reset-wallet
v-if="isReset"
v-bind="$attrs"
@window:close="close"
@window:back="startAction"
/>
Expand Down
1 change: 1 addition & 0 deletions packages/keyring/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ class KeyRing {
}

async reset(): Promise<void> {
this.lock();
const resetPromises = Object.values(configs.STORAGE_KEYS).map((name) =>
this.#storage.remove(name)
);
Expand Down

1 comment on commit 6e12049

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.