diff --git a/src/gui/src/helpers.js b/src/gui/src/helpers.js index 3d15fb02..2fcfb46c 100644 --- a/src/gui/src/helpers.js +++ b/src/gui/src/helpers.js @@ -432,7 +432,7 @@ window.refresh_user_data = async (auth_token)=>{ } } -window.update_auth_data = (auth_token, user)=>{ +window.update_auth_data = async (auth_token, user)=>{ window.auth_token = auth_token; localStorage.setItem('auth_token', auth_token); @@ -493,6 +493,9 @@ window.update_auth_data = (auth_token, user)=>{ $('.user-options-login-btn, .user-options-create-account-btn').hide(); $('.user-options-menu-btn').show(); } + + // Search and store user templates + window.file_templates = await window.available_templates() } window.mutate_user_preferences = function(user_preferences_delta) { @@ -838,7 +841,6 @@ window.create_file = async(options)=>{ } window.available_templates = async () => { - console.log(window.user.username) const baseRoute = `/${window.user.username}` const keywords = ["template", "templates", i18n('template')] //make sure all its lowercase diff --git a/src/gui/src/initgui.js b/src/gui/src/initgui.js index a28b1a65..cd7bf0b3 100644 --- a/src/gui/src/initgui.js +++ b/src/gui/src/initgui.js @@ -108,8 +108,6 @@ const launch_services = async function (options) { const svc_process = globalThis.services.get('process'); svc_process.get_init().chstatus(PROCESS_RUNNING); } - // Search and store user templates - window.file_templates = await window.available_templates() }; // This code snippet addresses the issue flagged by Lighthouse regarding the use of