diff --git a/front-end/src/renderer/components/ImportExternalPrivateKeyModal.vue b/front-end/src/renderer/components/ImportExternalPrivateKeyModal.vue index f385c4c3f..360ba2aa9 100644 --- a/front-end/src/renderer/components/ImportExternalPrivateKeyModal.vue +++ b/front-end/src/renderer/components/ImportExternalPrivateKeyModal.vue @@ -4,6 +4,7 @@ import { reactive, watch } from 'vue'; import { Prisma } from '@prisma/client'; import useUserStore from '@renderer/stores/storeUser'; +import useContactsStore from '@renderer/stores/storeContacts'; import { useToast } from 'vue-toast-notification'; import usePersonalPassword from '@renderer/composables/usePersonalPassword'; @@ -14,6 +15,7 @@ import { assertUserLoggedIn, getErrorMessage, isLoggedInOrganization, + safeAwait, safeDuplicateUploadKey, } from '@renderer/utils'; @@ -32,6 +34,7 @@ const emit = defineEmits(['update:show']); /* Stores */ const user = useUserStore(); +const contacts = useContactsStore(); /* Composables */ const toast = useToast(); @@ -78,6 +81,7 @@ const handleImportExternalKey = async () => { await user.storeKey(keyPair, null, personalPassword, false); await user.refetchUserState(); + await safeAwait(contacts.fetch()); emit('update:show', false); diff --git a/front-end/src/renderer/components/KeyPair/ImportEncrypted/components/DecryptKeys.vue b/front-end/src/renderer/components/KeyPair/ImportEncrypted/components/DecryptKeys.vue index a5bb36167..cfa96db9d 100644 --- a/front-end/src/renderer/components/KeyPair/ImportEncrypted/components/DecryptKeys.vue +++ b/front-end/src/renderer/components/KeyPair/ImportEncrypted/components/DecryptKeys.vue @@ -2,13 +2,14 @@ import { computed, ref } from 'vue'; import useUserStore from '@renderer/stores/storeUser'; +import useContactsStore from '@renderer/stores/storeContacts'; import { useToast } from 'vue-toast-notification'; import usePersonalPassword from '@renderer/composables/usePersonalPassword'; import { hashData } from '@renderer/services/electronUtilsService'; -import { getKeysFromSecretHash, getRecoveryPhraseHashValue } from '@renderer/utils'; +import { getKeysFromSecretHash, getRecoveryPhraseHashValue, safeAwait } from '@renderer/utils'; import DecryptKeyModal from '@renderer/components/KeyPair/ImportEncrypted/components/DecryptKeyModal.vue'; @@ -25,6 +26,7 @@ const emit = defineEmits<{ /* Stores */ const user = useUserStore(); +const contacts = useContactsStore(); /* Composables */ const toast = useToast(); @@ -101,6 +103,7 @@ async function end() { await user.refetchKeys(); user.refetchAccounts(); await user.refetchUserState(); + safeAwait(contacts.fetch()); } function reset() { diff --git a/front-end/src/renderer/pages/RestoreKey/RestoreKey.vue b/front-end/src/renderer/pages/RestoreKey/RestoreKey.vue index 29d861920..dca3a4fcf 100644 --- a/front-end/src/renderer/pages/RestoreKey/RestoreKey.vue +++ b/front-end/src/renderer/pages/RestoreKey/RestoreKey.vue @@ -4,6 +4,7 @@ import { PrivateKey } from '@hashgraph/sdk'; import { Prisma } from '@prisma/client'; import useUserStore from '@renderer/stores/storeUser'; +import useContactsStore from '@renderer/stores/storeContacts'; import { useRouter } from 'vue-router'; import { useToast } from 'vue-toast-notification'; @@ -30,6 +31,7 @@ import RecoveryPhraseNicknameInput from '@renderer/components/RecoveryPhrase/Rec /* Stores */ const user = useUserStore(); +const contacts = useContactsStore(); /* Composables */ const toast = useToast(); @@ -164,6 +166,7 @@ const handleSaveKey = async () => { toast.success('Key pair saved'); router.push({ name: 'settingsKeys' }); + await safeAwait(contacts.fetch()); } catch (error) { toast.error(getErrorMessage(error, 'Failed to store private key')); } finally {