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

All: Fixed various issues regarding encryption and decryptino of resources, and started doing GUI for Electron app

This commit is contained in:
Laurent Cozic
2017-12-21 20:06:08 +01:00
parent 7750b954fc
commit 6683da804b
12 changed files with 81 additions and 89 deletions

View File

@ -268,14 +268,16 @@ class BaseApplication {
}
if ((action.type == 'SETTING_UPDATE_ONE' && (action.key.indexOf('encryption.') === 0)) || (action.type == 'SETTING_UPDATE_ALL')) {
await EncryptionService.instance().loadMasterKeysFromSettings();
DecryptionWorker.instance().scheduleStart();
const loadedMasterKeyIds = EncryptionService.instance().loadedMasterKeyIds();
if (this.hasGui()) {
await EncryptionService.instance().loadMasterKeysFromSettings();
DecryptionWorker.instance().scheduleStart();
const loadedMasterKeyIds = EncryptionService.instance().loadedMasterKeyIds();
this.dispatch({
type: 'MASTERKEY_REMOVE_MISSING',
ids: loadedMasterKeyIds,
});
this.dispatch({
type: 'MASTERKEY_REMOVE_MISSING',
ids: loadedMasterKeyIds,
});
}
}
if (action.type == 'TAG_SELECT' || action.type === 'TAG_DELETE') {
@ -302,6 +304,10 @@ class BaseApplication {
reg.setupRecurrentSync();
}
if (this.hasGui() && action.type === 'SYNC_GOT_ENCRYPTED_ITEM') {
DecryptionWorker.instance().scheduleStart();
}
return result;
}
@ -411,7 +417,6 @@ class BaseApplication {
DecryptionWorker.instance().setLogger(this.logger_);
DecryptionWorker.instance().setEncryptionService(EncryptionService.instance());
await EncryptionService.instance().loadMasterKeysFromSettings();
DecryptionWorker.instance().scheduleStart();
let currentFolderId = Setting.value('activeFolderId');
let currentFolder = null;