From 959ab8e2d8bf09904bfdf4898ea2884bb71fbff6 Mon Sep 17 00:00:00 2001 From: ddang Date: Wed, 29 Nov 2023 01:58:57 -0800 Subject: [PATCH 1/2] Checking for clearing chat history --- src/lib/components/layout/Sidebar.svelte | 105 ++++++++++++++++++----- 1 file changed, 84 insertions(+), 21 deletions(-) diff --git a/src/lib/components/layout/Sidebar.svelte b/src/lib/components/layout/Sidebar.svelte index 283621cad..50d2f17d5 100644 --- a/src/lib/components/layout/Sidebar.svelte +++ b/src/lib/components/layout/Sidebar.svelte @@ -24,6 +24,8 @@ let showDropdown = false; + let showWarningHistory = false; + onMount(async () => { if (window.innerWidth > 1280) { show = true; @@ -447,30 +449,91 @@
Export
- + + + + {:else} + + {/if} {#if $user !== undefined} - {#if showWarningHistory} + {#if showDeleteHistoryConfirm}
- Are you sure? + Are you sure?
@@ -474,7 +474,7 @@ class="hover:text-white transition" on:click={() => { deleteChatHistory(); - showWarningHistory = false; + showDeleteHistoryConfirm = false; }} > { - showWarningHistory = false; + showDeleteHistoryConfirm = false; }} > { - showWarningHistory = true; + showDeleteHistoryConfirm = true; }}>