protect tree will check if password is set and send user to options if not

This commit is contained in:
zadam
2021-12-30 23:55:36 +01:00
parent 8120f1bf25
commit a38ccde8bc
9 changed files with 51 additions and 8 deletions

View File

@@ -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);
}