From eb5c49442ad7f807535aee85e2680329d9c151eb Mon Sep 17 00:00:00 2001 From: Break27 Date: Tue, 11 Aug 2026 23:17:06 +0800 Subject: [PATCH] fix: promise chaining --- index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 7a90cae..9360973 100644 --- a/index.html +++ b/index.html @@ -278,7 +278,7 @@ $.set('#send', 'click', async () => { $('#send').classList.remove('pulse'); $('#send').disabled = true; busy = true; - busy = await handlePrimaryButtonClick().then(() => false, e => console.error(e)); + busy = await handlePrimaryButtonClick().catch(e => console.error(e)).then(() => false); }); $.set('#cancel', 'click', async () => { @@ -433,7 +433,7 @@ while (await new Promise(o => setTimeout(o, 1000, true))) { await Rpc2.notify('close'); } catch (e) { if (Error.isError(e) && e.name === 'NoModificationAllowedError') continue; - await new Promise(fn => fn(writable.abort())).catch(() => null); + await new Promise(fn => fn(writable.abort())).catch(() => void 0); alert('(ERROR) ' + new String(e ?? 'File operation failed')); } save = false;