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; + };