mirror of
https://github.com/zadam/trilium.git
synced 2025-11-18 03:00:41 +01:00
unprotecting note outside of protected session is not forbidden because it could overwrite previous note
This commit is contained in:
@@ -119,11 +119,12 @@ async function saveNoteIfChanged() {
|
||||
}
|
||||
|
||||
function setNoteBackgroundIfProtected(note) {
|
||||
const isProtected = !!note.isProtected;
|
||||
const isProtected = note.isProtected;
|
||||
|
||||
$noteDetailWrapper.toggleClass("protected", isProtected);
|
||||
$protectButton.toggleClass("active", isProtected);
|
||||
$unprotectButton.toggleClass("active", !isProtected);
|
||||
$unprotectButton.prop("disabled", !protectedSessionHolder.isProtectedSessionAvailable());
|
||||
}
|
||||
|
||||
let isNewNoteCreated = false;
|
||||
@@ -157,8 +158,6 @@ async function loadNoteDetail(noteId) {
|
||||
|
||||
setNoteBackgroundIfProtected(currentNote);
|
||||
|
||||
await handleProtectedSession();
|
||||
|
||||
$noteDetailWrapper.show();
|
||||
|
||||
noteChangeDisabled = true;
|
||||
@@ -171,6 +170,8 @@ async function loadNoteDetail(noteId) {
|
||||
|
||||
$noteDetailComponents.hide();
|
||||
|
||||
await handleProtectedSession();
|
||||
|
||||
await getComponent(currentNote.type).show();
|
||||
}
|
||||
finally {
|
||||
|
||||
Reference in New Issue
Block a user