Allow delete all chats when chat not selected.

This commit is contained in:
Webifi 2023-06-14 12:52:07 -05:00
parent 20b93cc59e
commit c125d7b637
1 changed files with 2 additions and 1 deletions

View File

@ -74,6 +74,7 @@
} }
const confirmClearChats = () => { const confirmClearChats = () => {
if (!sortedChats.length) return
close() close()
openModal(PromptConfirm, { openModal(PromptConfirm, {
title: 'Delete ALL Chat', title: 'Delete ALL Chat',
@ -148,7 +149,7 @@
<a href={'#'} class="dropdown-item" class:is-disabled={!chatId} on:click|preventDefault={() => { if (chatId) close(); delChat() }}> <a href={'#'} class="dropdown-item" class:is-disabled={!chatId} on:click|preventDefault={() => { if (chatId) close(); delChat() }}>
<span class="menu-icon"><Fa icon={faTrash}/></span> Delete Chat <span class="menu-icon"><Fa icon={faTrash}/></span> Delete Chat
</a> </a>
<a href={'#'} class="dropdown-item" on:click|preventDefault={() => { if (chatId) confirmClearChats() }}> <a href={'#'} class="dropdown-item" class:is-disabled={$chatsStorage && !$chatsStorage[0]} on:click|preventDefault={() => { confirmClearChats() }}>
<span class="menu-icon"><Fa icon={faTrashCan}/></span> Delete ALL Chats <span class="menu-icon"><Fa icon={faTrashCan}/></span> Delete ALL Chats
</a> </a>
<hr class="dropdown-divider"> <hr class="dropdown-divider">