Skip to content

Commit 421aba7

Browse files
committed
refac: hide channel add button for users
1 parent 09b6ea3 commit 421aba7

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/lib/components/layout/Sidebar.svelte

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -914,15 +914,15 @@
914914
name={$i18n.t('Channels')}
915915
chevron={false}
916916
dragAndDrop={false}
917-
onAdd={async () => {
918-
if ($user?.role === 'admin') {
919-
await tick();
917+
onAdd={$user?.role === 'admin'
918+
? async () => {
919+
await tick();
920920

921-
setTimeout(() => {
922-
showCreateChannel = true;
923-
}, 0);
924-
}
925-
}}
921+
setTimeout(() => {
922+
showCreateChannel = true;
923+
}, 0);
924+
}
925+
: null}
926926
onAddLabel={$i18n.t('Create Channel')}
927927
>
928928
{#each $channels as channel}

0 commit comments

Comments
 (0)