add confirmation prompt before deleting all chats

This commit is contained in:
Emil Elgaard 2023-03-24 09:57:42 -04:00
parent 265f361876
commit f6f17bfd0d
1 changed files with 5 additions and 6 deletions

View File

@ -41,14 +41,13 @@
>
</li>
<li>
<a
href={'#/'}
class="panel-block"
<a class="panel-block"
class:is-disabled={!$apiKeyStorage}
on:click={() => {
replace('#/').then(() => {
clearChats()
})
const confirmDelete = window.confirm('Are you sure you want to delete all your chats?')
if (confirmDelete) {
replace('#/').then(() => clearChats())
}
}}><span class="greyscale mr-2">🗑️</span> Clear chats</a
>
</li>