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