From 04305722a783902d1410beb622686135ad9f4c84 Mon Sep 17 00:00:00 2001 From: Mechiel Lukkien Date: Thu, 10 Oct 2024 14:29:52 +0200 Subject: [PATCH] webmail: if we don't have loaded account settings yet, abort loading the popup after showing an error that the settings aren't available yet missing returning/throwing error. based on screenshot with unhandled js error in issue #218 by mgkirs --- webmail/webmail.js | 2 +- webmail/webmail.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/webmail/webmail.js b/webmail/webmail.js index 2c63125..cce8a83 100644 --- a/webmail/webmail.js +++ b/webmail/webmail.js @@ -2391,7 +2391,7 @@ const cmdSettings = async () => { let showAddressSecurity; let showHTML; if (!accountSettings) { - window.alert('No account settings fetched yet.'); + throw new Error('No account settings fetched yet.'); } const remove = popup(css('popupSettings', { padding: '1em 1em 2em 1em', minWidth: '30em' }), dom.h1('Settings'), dom.form(async function submit(e) { e.preventDefault(); diff --git a/webmail/webmail.ts b/webmail/webmail.ts index dd8be02..2e5755f 100644 --- a/webmail/webmail.ts +++ b/webmail/webmail.ts @@ -1117,7 +1117,7 @@ const cmdSettings = async () => { let showHTML: HTMLInputElement if (!accountSettings) { - window.alert('No account settings fetched yet.') + throw new Error('No account settings fetched yet.') } const remove = popup(