renamed currentNote to activeNote to be consistent with frontend API

This commit is contained in:
zadam
2019-03-14 20:21:27 +01:00
parent 0d0464549f
commit ef40c66344
22 changed files with 117 additions and 117 deletions

View File

@@ -112,13 +112,13 @@ async function enterProtectedSessionOnServer(password) {
}
async function protectNoteAndSendToServer() {
if (noteDetailService.getCurrentNote().isProtected) {
if (noteDetailService.getActiveNote().isProtected) {
return;
}
await ensureProtectedSession(true, true);
const note = noteDetailService.getCurrentNote();
const note = noteDetailService.getActiveNote();
note.isProtected = true;
await noteDetailService.saveNote(note);
@@ -129,10 +129,10 @@ async function protectNoteAndSendToServer() {
}
async function unprotectNoteAndSendToServer() {
const currentNote = noteDetailService.getCurrentNote();
const activeNote = noteDetailService.getActiveNote();
if (!currentNote.isProtected) {
infoService.showAndLogError(`Note ${currentNote.noteId} is not protected`);
if (!activeNote.isProtected) {
infoService.showAndLogError(`Note ${activeNote.noteId} is not protected`);
return;
}
@@ -146,11 +146,11 @@ async function unprotectNoteAndSendToServer() {
return;
}
currentNote.isProtected = false;
activeNote.isProtected = false;
await noteDetailService.saveNote(currentNote);
await noteDetailService.saveNote(activeNote);
treeService.setProtected(currentNote.noteId, currentNote.isProtected);
treeService.setProtected(activeNote.noteId, activeNote.isProtected);
noteDetailService.updateNoteView();
}