properly close modal stack in order on escape

This commit is contained in:
Webifi
2023-06-05 16:13:40 -05:00
parent 939d69fe46
commit c672236412
10 changed files with 51 additions and 38 deletions

View File

@@ -9,6 +9,7 @@
import NewChat from './lib/NewChat.svelte'
import { chatsStorage, apiKeyStorage } from './lib/Storage.svelte'
import { Modals, closeModal } from 'svelte-modals'
import { triggerModalEsc } from './lib/Util.svelte'
// The definition of the routes with some conditions
const routes = {
@@ -51,6 +52,10 @@
/>
</Modals>
<svelte:window
on:keydown={(e) => triggerModalEsc(e)}
/>
<style>
.backdrop {
position: fixed;