From b69d2d0fefa541e8486bc98969f5d0844a6f5de7 Mon Sep 17 00:00:00 2001 From: April Hall Date: Fri, 7 Feb 2025 11:32:09 -0500 Subject: [PATCH] fix: Close dialog on successful channel creation --- src/lib/components/channelDialog.svelte | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/lib/components/channelDialog.svelte b/src/lib/components/channelDialog.svelte index 2dfd4a2..d441dcd 100644 --- a/src/lib/components/channelDialog.svelte +++ b/src/lib/components/channelDialog.svelte @@ -7,11 +7,18 @@ import type { NewChannelSchema } from '$lib/types/schema'; import { Label } from '$lib/components/ui/label/index'; + let open: boolean = $state(false); let { data }: { data: SuperValidated> } = $props(); - const { form, errors, constraints, enhance } = superForm(data); + const { form, errors, constraints, enhance } = superForm(data, { + onResult: ({ result }) => { + if (result.type === 'success') { + open = false; + } + }, + }); - + Create Channel