Explorar o código

fix: shift delete

Timothy J. Baek hai 10 meses
pai
achega
5d0b77e64a

+ 7 - 3
src/lib/components/layout/Sidebar.svelte

@@ -464,9 +464,13 @@
 						on:select={() => {
 						on:select={() => {
 							selectedChatId = chat.id;
 							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}
 				{/each}

+ 1 - 1
src/lib/components/layout/Sidebar/ChatItem.svelte

@@ -201,7 +201,7 @@
 					<button
 					<button
 						class=" self-center dark:hover:text-white transition"
 						class=" self-center dark:hover:text-white transition"
 						on:click={() => {
 						on:click={() => {
-							deleteChat(chat.id);
+							dispatch('delete', 'shift');
 						}}
 						}}
 						type="button"
 						type="button"
 					>
 					>