1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-07-06 23:56:13 +02:00

Mobile,Desktop,CLI: Fixes #10856: Decrypt master keys only as needed (#10990)

This commit is contained in:
Henry Heino
2024-09-07 03:56:13 -07:00
committed by GitHub
parent ac2258769a
commit 0bfa28d795
4 changed files with 78 additions and 25 deletions

View File

@ -506,6 +506,13 @@ export default class BaseItem extends BaseModel {
masterKeyId: share && share.master_key_id ? share.master_key_id : '',
});
} catch (error) {
if (error.code === 'masterKeyNotLoaded' && error.masterKeyId) {
this.dispatch?.({
type: 'MASTERKEY_ADD_NOT_LOADED',
id: error.masterKeyId,
});
}
const msg = [`Could not encrypt item ${item.id}`];
if (error && error.message) msg.push(error.message);
const newError = new Error(msg.join(': '));