mirror of
https://github.com/zadam/trilium.git
synced 2025-11-10 15:25:51 +01:00
protect tree will check if password is set and send user to options if not
This commit is contained in:
@@ -5,6 +5,7 @@ import ws from "./ws.js";
|
||||
import appContext from "./app_context.js";
|
||||
import froca from "./froca.js";
|
||||
import utils from "./utils.js";
|
||||
import options from "./options.js";
|
||||
|
||||
let protectedSessionDeferred = null;
|
||||
|
||||
@@ -18,6 +19,11 @@ async function leaveProtectedSession() {
|
||||
function enterProtectedSession() {
|
||||
const dfd = $.Deferred();
|
||||
|
||||
if (!options.is("isPasswordSet")) {
|
||||
import("../dialogs/password_not_set.js").then(dialog => dialog.show());
|
||||
return dfd;
|
||||
}
|
||||
|
||||
if (protectedSessionHolder.isProtectedSessionAvailable()) {
|
||||
dfd.resolve(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user