mirror of
https://github.com/zadam/trilium.git
synced 2025-11-12 08:15:52 +01:00
converted protected session password dialog to new pattern
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user