From e29a999dc910afad91995221cb4bb7c274f87cd6 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Wed, 15 May 2024 19:01:02 -1000 Subject: [PATCH] fix: add user modal error handling --- src/lib/components/admin/AddUserModal.svelte | 7 +- .../chat/Messages/ResponseMessage.svelte | 142 +++++++++--------- src/routes/(app)/admin/+page.svelte | 2 +- 3 files changed, 77 insertions(+), 74 deletions(-) diff --git a/src/lib/components/admin/AddUserModal.svelte b/src/lib/components/admin/AddUserModal.svelte index 57ad9362c..a38177a75 100644 --- a/src/lib/components/admin/AddUserModal.svelte +++ b/src/lib/components/admin/AddUserModal.svelte @@ -73,13 +73,16 @@ console.log(idx, columns); if (idx > 0) { - if (columns.length === 4 && ['admin', 'user', 'pending'].includes(columns[3])) { + if ( + columns.length === 4 && + ['admin', 'user', 'pending'].includes(columns[3].toLowerCase()) + ) { const res = await addUser( localStorage.token, columns[0], columns[1], columns[2], - columns[3] + columns[3].toLowerCase() ).catch((error) => { toast.error(`Row ${idx + 1}: ${error}`); return null; diff --git a/src/lib/components/chat/Messages/ResponseMessage.svelte b/src/lib/components/chat/Messages/ResponseMessage.svelte index 7538eaf93..925e09c36 100644 --- a/src/lib/components/chat/Messages/ResponseMessage.svelte +++ b/src/lib/components/chat/Messages/ResponseMessage.svelte @@ -602,77 +602,6 @@ - {#if !readOnly} - - - - - - - - {/if} - + + + + + + {/if} + {#if isLastMessage && !readOnly}