fixed unloading the encrypted page after encryption timeout by simply reloading the app completely plus some unrelated refactorings

This commit is contained in:
azivner
2017-11-04 21:02:56 -04:00
parent 9c88fc6060
commit b192336113
6 changed files with 19 additions and 34 deletions

View File

@@ -22,10 +22,6 @@ const encryption = (function() {
encryptedDataKey = settings.encrypted_data_key;
});
function setEncryptionSalt(encSalt) {
encryptionSalt = encSalt;
}
function setEncryptedDataKey(encDataKey) {
encryptedDataKey = encDataKey;
}
@@ -149,15 +145,9 @@ const encryption = (function() {
dataKey = null;
if (noteEditor.getCurrentNote().detail.encryption > 0) {
noteEditor.loadNoteToEditor(noteEditor.getCurrentNoteId());
for (const noteId of glob.allNoteIds) {
const note = getNodeByKey(noteId);
if (note.data.encryption > 0) {
note.setTitle("[encrypted]");
}
}
// most secure solution - guarantees nothing remained in memory
// since this expires because user doesn't use the app, it shouldn't be disruptive
window.location.reload(true);
}
}