mirror of
https://github.com/zadam/trilium.git
synced 2025-11-02 03:16:11 +01:00
hiding protected session dialog when moving over to unprotected note
This commit is contained in:
@@ -69,13 +69,7 @@ const protected_session = (function() {
|
||||
noteTree.reload();
|
||||
|
||||
if (protectedSessionDeferred !== null) {
|
||||
// this may fal if the dialog has not been previously opened
|
||||
try {
|
||||
dialogEl.dialog('close');
|
||||
}
|
||||
catch(e) {}
|
||||
|
||||
passwordEl.val('');
|
||||
ensureDialogIsClosed(dialogEl, passwordEl);
|
||||
|
||||
protectedSessionDeferred.resolve();
|
||||
|
||||
@@ -83,6 +77,16 @@ const protected_session = (function() {
|
||||
}
|
||||
}
|
||||
|
||||
function ensureDialogIsClosed() {
|
||||
// this may fal if the dialog has not been previously opened
|
||||
try {
|
||||
dialogEl.dialog('close');
|
||||
}
|
||||
catch (e) {}
|
||||
|
||||
passwordEl.val('');
|
||||
}
|
||||
|
||||
async function enterProtectedSession(password) {
|
||||
return await $.ajax({
|
||||
url: baseApiUrl + 'login/protected',
|
||||
@@ -182,6 +186,7 @@ const protected_session = (function() {
|
||||
unprotectNoteAndSendToServer,
|
||||
getProtectedSessionId,
|
||||
touchProtectedSession,
|
||||
protectSubTree
|
||||
protectSubTree,
|
||||
ensureDialogIsClosed
|
||||
};
|
||||
})();
|
||||
Reference in New Issue
Block a user