From ae9f5efed0dda247cb1fefcf13a21ad594ce2320 Mon Sep 17 00:00:00 2001 From: jelveh Date: Fri, 28 Feb 2025 10:28:40 -0800 Subject: [PATCH] send event after toolbar is ready and after account is saved --- src/gui/src/UI/UIDesktop.js | 3 +++ src/gui/src/UI/UIWindowSaveAccount.js | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/gui/src/UI/UIDesktop.js b/src/gui/src/UI/UIDesktop.js index 8372c80a..ea51e508 100644 --- a/src/gui/src/UI/UIDesktop.js +++ b/src/gui/src/UI/UIDesktop.js @@ -1145,6 +1145,9 @@ async function UIDesktop(options){ // prepend toolbar to desktop $(ht).insertBefore(el_desktop); + // send event + window.dispatchEvent(new CustomEvent('toolbar:ready')); + // notification container $('body').append(`
${i18n('close_all')}
`); diff --git a/src/gui/src/UI/UIWindowSaveAccount.js b/src/gui/src/UI/UIWindowSaveAccount.js index 0fe540b8..340816d3 100644 --- a/src/gui/src/UI/UIWindowSaveAccount.js +++ b/src/gui/src/UI/UIWindowSaveAccount.js @@ -152,6 +152,8 @@ async function UIWindowSaveAccount(options){ "Authorization": "Bearer "+window.auth_token }, success: async function (data){ + window.dispatchEvent(new CustomEvent('account-saved', { detail: { data: data} })); + window.update_auth_data(data.token, data.user) //close this window