From cdc3e194351a5aeea9a036f5d343c00094276530 Mon Sep 17 00:00:00 2001 From: Josh Moore Date: Sun, 16 Jul 2023 23:07:53 -0600 Subject: [PATCH] feat: enable/disable Submit button --- frontend/setup.mts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/setup.mts b/frontend/setup.mts index b4084d9..ed9bd4c 100644 --- a/frontend/setup.mts +++ b/frontend/setup.mts @@ -30,6 +30,7 @@ document.addEventListener('DOMContentLoaded', () => { // * Setup button click handler Elements.submitButton.addEventListener('click', async () => { + Elements.submitButton.disabled = true; // Base configuration values const config: UserConfiguration = { @@ -81,6 +82,7 @@ document.addEventListener('DOMContentLoaded', () => { if (!data.success) alert(data.message); else alert('good?'); }) - .catch((err) => errAlert('POST to /setup failed!', err)); + .catch((err) => errAlert('POST to /setup failed!', err)) + .finally(() => Elements.submitButton.disabled = false); }); });