From 5d0b77e64a17712c66a797bf1dc81d81ae248aab Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Sun, 16 Jun 2024 10:27:34 -0600 Subject: [PATCH] fix: shift delete --- src/lib/components/layout/Sidebar.svelte | 10 +++++++--- src/lib/components/layout/Sidebar/ChatItem.svelte | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/lib/components/layout/Sidebar.svelte b/src/lib/components/layout/Sidebar.svelte index e844d4f39..8b4c5664e 100644 --- a/src/lib/components/layout/Sidebar.svelte +++ b/src/lib/components/layout/Sidebar.svelte @@ -464,9 +464,13 @@ on:select={() => { selectedChatId = chat.id; }} - on:delete={() => { - deleteChat = chat; - showDeleteConfirm = true; + on:delete={(e) => { + if ((e?.detail ?? '') === 'shift') { + deleteChatHandler(chat.id); + } else { + deleteChat = chat; + showDeleteConfirm = true; + } }} /> {/each} diff --git a/src/lib/components/layout/Sidebar/ChatItem.svelte b/src/lib/components/layout/Sidebar/ChatItem.svelte index 150490690..8ed0d674f 100644 --- a/src/lib/components/layout/Sidebar/ChatItem.svelte +++ b/src/lib/components/layout/Sidebar/ChatItem.svelte @@ -201,7 +201,7 @@