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

All: getting encryption service and UI to work

This commit is contained in:
Laurent Cozic
2017-12-14 19:39:13 +00:00
parent d9c1e30e9b
commit 2c608bca3c
12 changed files with 328 additions and 68 deletions

View File

@ -374,7 +374,24 @@ const reducer = (state = defaultState, action) => {
if (state.missingMasterKeys.indexOf(action.id) < 0) {
newState = Object.assign({}, state);
newState.missingMasterKeys.push(action.id);
const keys = newState.missingMasterKeys.slice();
keys.push(action.id);
newState.missingMasterKeys = keys;
}
break;
case 'MASTERKEY_REMOVE_MISSING':
const ids = action.id ? [action.id] : action.ids;
for (let i = 0; i < ids.length; i++) {
const id = ids[i];
const index = state.missingMasterKeys.indexOf(id);
if (index >= 0) {
newState = Object.assign({}, state);
const keys = newState.missingMasterKeys.slice();
keys.splice(index, 1);
newState.missingMasterKeys = keys;
}
}
break;