From 700894a13d243b129632190316d1cabf713be033 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Thu, 18 Sep 2025 18:02:35 -0500 Subject: [PATCH] refac: channel modal --- .../components/layout/Sidebar/ChannelModal.svelte | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/lib/components/layout/Sidebar/ChannelModal.svelte b/src/lib/components/layout/Sidebar/ChannelModal.svelte index e59b3e42c..ff5451121 100644 --- a/src/lib/components/layout/Sidebar/ChannelModal.svelte +++ b/src/lib/components/layout/Sidebar/ChannelModal.svelte @@ -44,8 +44,12 @@ accessControl = channel.access_control; }; - $: if (channel) { - init(); + $: if (show) { + if (channel) { + init(); + } + } else { + resetHandler(); } let showDeleteConfirmDialog = false; @@ -68,6 +72,12 @@ show = false; }; + + const resetHandler = () => { + name = ''; + accessControl = {}; + loading = false; + };