converted protected session password dialog to new pattern

This commit is contained in:
zadam
2022-06-16 15:28:51 +02:00
parent 3255607b09
commit e140daa952
7 changed files with 68 additions and 33 deletions

View File

@@ -31,7 +31,7 @@ function enterProtectedSession() {
// using deferred instead of promise because it allows resolving from outside
protectedSessionDeferred = dfd;
import("../dialogs/protected_session.js").then(dialog => dialog.show());
appContext.triggerCommand("showProtectedSessionPasswordDialog");
}
return dfd.promise();
@@ -61,13 +61,13 @@ ws.subscribeToMessages(async message => {
if (message.type === 'protectedSessionLogin') {
await reloadData();
await appContext.triggerEvent('frocaReloaded');
await appContext.triggerEvent('frocaReloaded');
appContext.triggerEvent('protectedSessionStarted');
if (protectedSessionDeferred !== null) {
import("../dialogs/protected_session.js").then(dialog => dialog.close());
appContext.triggerCommand("closeProtectedSessionPasswordDialog");
if (protectedSessionDeferred !== null) {
protectedSessionDeferred.resolve(true);
protectedSessionDeferred = null;
}