Skip to content

Commit

Permalink
feat: mnemonic caching update (#1292)
Browse files Browse the repository at this point in the history
Signed-off-by: Svetoslav Borislavov <[email protected]>
  • Loading branch information
SvetBorislavov authored Dec 4, 2024
1 parent 333b403 commit 460490b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script setup lang="ts">
import type { USER_PASSWORD_MODAL_TYPE } from '@renderer/providers';
import { inject, onBeforeUnmount, ref } from 'vue';
import { inject, onMounted, ref } from 'vue';
import useUserStore from '@renderer/stores/storeUser';
Expand Down Expand Up @@ -124,7 +124,7 @@ const storeKeys = async (
};
/* Hooks */
onBeforeUnmount(() => {
onMounted(() => {
user.recoveryPhrase = null;
});
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,17 @@ import { ref } from 'vue';
import { RESTORE_KEY } from '@renderer/router';
import useUserStore from '@renderer/stores/storeUser';
import { useRouter } from 'vue-router';
import AppButton from '@renderer/components/ui/AppButton.vue';
import ImportExternalPrivateKeyModal from '@renderer/components/ImportExternalPrivateKeyModal.vue';
import ImportEncrypted from '@renderer/components/KeyPair/ImportEncrypted';
/* Stores */
const user = useUserStore();
/* Composables */
const router = useRouter();
Expand All @@ -25,7 +30,10 @@ const handleImportExternal = (type: 'ED25519' | 'ECDSA') => {
const handleImportEncrypted = () => importEncryptedRef.value?.process();
const handleImportMnemonic = () => router.push({ name: RESTORE_KEY });
const handleImportMnemonic = async () => {
await user.setRecoveryPhrase(null);
await router.push({ name: RESTORE_KEY });
};
</script>
<template>
<div class="dropdown">
Expand Down

0 comments on commit 460490b

Please sign in to comment.