{ location.href = '/'; // createNewChat(); }} >
New Chat
{#each _chats as chat, i}
{ // goto(`/c/${chat.id}`); if (chat.id !== chatTitleEditIdx) { chatTitleEditIdx = null; chatTitle = ''; } if (chat.id !== $chatId) { loadChat(chat.id); } }} >
{#if chatTitleEditIdx === chat.id}
{:else} {chat.title} {/if}
{#if chat.id === $chatId}
{#if chatTitleEditIdx === chat.id}
{ editChatTitle(chat.id, chatTitle); chatTitleEditIdx = null; chatTitle = ''; }} >
{ chatTitleEditIdx = null; chatTitle = ''; }} >
{:else}
{ chatTitle = chat.title; chatTitleEditIdx = chat.id; // editChatTitle(chat.id, 'a'); }} >
{ deleteChat(chat.id); }} >
{/if}
{/if}
{/each}
{ importFileInputElement.click(); // importChatHistory(); }} >
Import
{ exportChatHistory(); }} >
Export
{ deleteChatHistory(); }} >
Clear conversations
{#if $user !== undefined}
{ showDropdown = !showDropdown; }} on:focusout={() => { setTimeout(() => { showDropdown = false; }, 150); }} >
{$user.name}
{#if showDropdown}
{#if $user.role === 'admin'}
{ goto('/admin'); }} >
Admin Panel
{/if}
{ await showSettings.set(true); }} >
Settings
{ localStorage.removeItem('token'); location.href = '/auth'; }} >
Sign Out
{/if} {:else}
{ openSettings(); }} >
Settings
{/if}
{ show = !show; }} >