{#snippet sectionChecklist()} {#each availableSections as section (section)} {@const shown = !hiddenSections.includes(section)} {/each} {/snippet} {#snippet sectionVisibilityItems(id: string, close = () => {})} {@render sectionChecklist()} {/snippet} {#snippet sectionMoreMenu(id: string)}
{@render sectionVisibilityItems(id)}
{/snippet} applySelectedChatAction('delete', deleteSelectedIds)} /> { let { type, name, is_private, access_grants, group_ids, user_ids } = payload ?? {}; name = name?.trim(); if (type === 'dm') { if (!user_ids || user_ids.length === 0) { toast.error($i18n.t('Please select at least one user for Direct Message channel.')); return; } } else { if (!name) { toast.error($i18n.t('Channel name cannot be empty.')); return; } } const res = await createNewChannel(localStorage.token, { type: type, name: name, is_private: is_private, access_grants: access_grants, group_ids: group_ids, user_ids: user_ids }).catch((error) => { toast.error(`${error}`); return null; }); if (res) { $socket.emit('join-channels', { auth: { token: $user?.token } }); await initChannels(); showCreateChannel = false; showChannels = true; if (!openSidebarPage(`/channels/${res.id}`, res.name)) goto(`/channels/${res.id}`); } }} /> { await initTeams(); showTeams = true; goto(`/teams/${team.id}`); }} /> {#if $config?.features?.enable_folders && ($user?.role === 'admin' || ($user?.permissions?.features?.folders ?? true))} {#if showOpenDirectory} {/if} {/if} { if (!isResizing) return; if (activePointerId !== null && e.pointerId !== activePointerId) return; resizeSidebarHandler(e.clientX); }} on:pointerup={resizeEndHandler} on:pointercancel={resizeEndHandler} /> {#if $config?.features?.enable_notifications} {#key $user?.id}{/key} {/if} showSidebar.set(open)} let:visible let:progress let:panelStyle let:backdropStyle > {#if visible}
{ showSidebar.set(false); }} >
{/if} { if ($mobile) { showSidebar.set(false); } }} />
{#if $user !== undefined && $user !== null} {@render sectionChecklist()} {/if}
{/if} {#if visible || !$mobile} {#if !$mobile && visible} {/if} {/if}