delete account ui functionality

This commit is contained in:
2023-05-28 23:21:59 +02:00
parent b3f740770a
commit 06bfd4cd9e
6 changed files with 63 additions and 30 deletions

View File

@@ -69,10 +69,12 @@ export const encryptionKey = ref<EncryptionKey | null>()
export async function getEncryptionKey() {
encryptedEncryptionKey.value = (await getEncryptedEncryptionKey()) || undefined
if (!encryptedEncryptionKey.value || !clientKey.value) {
if (encryptedEncryptionKey.value && clientKey.value) {
encryptionKey.value = decrypt(encryptedEncryptionKey.value, clientKey.value)
} else if (!encryptedEncryptionKey.value) {
encryptionKey.value = null
} else {
encryptionKey.value = decrypt(encryptedEncryptionKey.value, clientKey.value)
encryptionKey.value = undefined
}
}