From 421aba7cd7cd708168b1f2565026c74525a67905 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Thu, 27 Nov 2025 04:49:29 -0500 Subject: [PATCH] refac: hide channel add button for users --- src/lib/components/layout/Sidebar.svelte | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/lib/components/layout/Sidebar.svelte b/src/lib/components/layout/Sidebar.svelte index 42e2ad8ded..70ff87eab8 100644 --- a/src/lib/components/layout/Sidebar.svelte +++ b/src/lib/components/layout/Sidebar.svelte @@ -914,15 +914,15 @@ name={$i18n.t('Channels')} chevron={false} dragAndDrop={false} - onAdd={async () => { - if ($user?.role === 'admin') { - await tick(); + onAdd={$user?.role === 'admin' + ? async () => { + await tick(); - setTimeout(() => { - showCreateChannel = true; - }, 0); - } - }} + setTimeout(() => { + showCreateChannel = true; + }, 0); + } + : null} onAddLabel={$i18n.t('Create Channel')} > {#each $channels as channel}