From c43c995bd2f7f9c8d4efc50e6b187f3f37bea947 Mon Sep 17 00:00:00 2001 From: pewdiepie-archdaemon Date: Mon, 1 Jun 2026 14:09:02 +0900 Subject: [PATCH] Hide pending email send toast after delay --- static/js/document.js | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/static/js/document.js b/static/js/document.js index 335ac08..fe8084a 100644 --- a/static/js/document.js +++ b/static/js/document.js @@ -2806,7 +2806,6 @@ import * as Modals from './modalManager.js'; let sendSpinner = null; let origBtnHtml = ''; let detachedEmailDoc = null; - let slowSendTimer = null; if (btn) { btn.disabled = true; origBtnHtml = btn.innerHTML; @@ -2852,10 +2851,7 @@ import * as Modals from './modalManager.js'; if (uiModule) uiModule.showToast('Send undone'); return; } - if (uiModule) uiModule.showToast('Sending...', 3500); - slowSendTimer = setTimeout(() => { - if (uiModule) uiModule.showToast('Still sending in background...', 12000); - }, 2000); + if (uiModule) uiModule.showToast('Sending...', 2000); const activeAccountId = await _resolveComposeSendAccountId(); const res = await fetch(`${API_BASE}/api/email/send`, { @@ -2870,10 +2866,6 @@ import * as Modals from './modalManager.js'; }), }); const data = await res.json(); - if (slowSendTimer) { - clearTimeout(slowSendTimer); - slowSendTimer = null; - } if (data.success) { if (uiModule) { uiModule.showToast('Message sent', { @@ -2940,10 +2932,6 @@ import * as Modals from './modalManager.js'; if (uiModule) uiModule.showError(data.error || 'Failed to send'); } } catch (e) { - if (slowSendTimer) { - clearTimeout(slowSendTimer); - slowSendTimer = null; - } _restoreDetachedEmailDoc(detachedEmailDoc); detachedEmailDoc = null; if (uiModule) uiModule.showError(e?.message ? `Failed to send email: ${e.message}` : 'Failed to send email');