diff --git a/frontend/src/lib/shopping/AddCustomItem.svelte b/frontend/src/lib/shopping/AddCustomItem.svelte index 90b9735..aad6c59 100644 --- a/frontend/src/lib/shopping/AddCustomItem.svelte +++ b/frontend/src/lib/shopping/AddCustomItem.svelte @@ -27,12 +27,14 @@ method="POST" action="?/addItem" use:enhance={() => { - return async ({ update }) => { - await update(); - customName = ''; - quantity = '1'; - unit = ''; - expanded = false; + return async ({ result, update }) => { + if (result.type === 'success') { + await update(); + customName = ''; + quantity = '1'; + unit = ''; + expanded = false; + } }; }} class="flex flex-col gap-2 rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface)] p-3" diff --git a/frontend/src/lib/shopping/ChecklistItem.svelte b/frontend/src/lib/shopping/ChecklistItem.svelte index 8e443aa..059073c 100644 --- a/frontend/src/lib/shopping/ChecklistItem.svelte +++ b/frontend/src/lib/shopping/ChecklistItem.svelte @@ -32,15 +32,17 @@ ); -