fix: promise chaining
This commit is contained in:
+2
-2
@@ -278,7 +278,7 @@ $.set('#send', 'click', async () => {
|
|||||||
$('#send').classList.remove('pulse');
|
$('#send').classList.remove('pulse');
|
||||||
$('#send').disabled = true;
|
$('#send').disabled = true;
|
||||||
busy = 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 () => {
|
$.set('#cancel', 'click', async () => {
|
||||||
@@ -433,7 +433,7 @@ while (await new Promise(o => setTimeout(o, 1000, true))) {
|
|||||||
await Rpc2.notify('close');
|
await Rpc2.notify('close');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (Error.isError(e) && e.name === 'NoModificationAllowedError') continue;
|
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'));
|
alert('(ERROR) ' + new String(e ?? 'File operation failed'));
|
||||||
}
|
}
|
||||||
save = false;
|
save = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user