1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-07-16 00:14:34 +02:00

Desktop: Fix handling of disabled master keys when enabling E2EE

This commit is contained in:
Laurent Cozic
2021-09-09 18:46:58 +01:00
parent 267c32143b
commit d33b99cffb
3 changed files with 7 additions and 13 deletions

View File

@ -161,7 +161,9 @@ export function showMissingMasterKeyMessage(syncInfo: SyncInfo, notLoadedMasterK
}
export function getDefaultMasterKey(): MasterKeyEntity {
const mk = getActiveMasterKey();
if (mk) return mk;
return MasterKey.latest();
let mk = getActiveMasterKey();
if (!mk || !mk.enabled) {
mk = MasterKey.latest();
}
return mk && mk.enabled ? mk : null;
}