delete account ui functionality
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -263,6 +263,7 @@ export const getNotes = async () => {
|
||||
if (encryptionKey.value === undefined || !user.value || !db.value) return
|
||||
const firebaseNotes = (await getDoc(doc(db.value, 'pages', user.value.uid))).data() as BaseNotes
|
||||
notes = encryptionKey.value ? decryptNotes(firebaseNotes, encryptionKey.value) : firebaseNotes
|
||||
console.log(encryptionKey.value)
|
||||
console.log('get notes from firebase', notes)
|
||||
}
|
||||
baseNotes.value = parseBaseNotes(notes)
|
||||
|
||||
Reference in New Issue
Block a user