Monitor relay connections for restricted responses and show error to user

This commit is contained in:
Jon Staab
2025-09-03 15:29:57 -07:00
parent 4001e877b4
commit 95698813c6
9 changed files with 226 additions and 75 deletions
+10 -12
View File
@@ -1,8 +1,7 @@
<script lang="ts">
import {page} from "$app/stores"
import Drawer from "@lib/components/Drawer.svelte"
import Dialog from "@lib/components/Dialog.svelte"
import {modals, clearModals} from "@app/util/modal"
import {modal, clearModals} from "@app/util/modal"
const onKeyDown = (e: any) => {
if (e.code === "Escape" && e.target === document.body) {
@@ -10,22 +9,21 @@
}
}
const hash = $derived($page.url.hash.slice(1))
const modal = $derived($modals[hash])
const m = $derived($modal)
</script>
<svelte:window onkeydown={onKeyDown} />
{#if modal?.options?.drawer}
<Drawer onClose={clearModals} {...modal.options}>
{#key modal.id}
<modal.component {...modal.props} />
{#if m?.options?.drawer}
<Drawer onClose={clearModals} {...m.options}>
{#key m.id}
<m.component {...m.props} />
{/key}
</Drawer>
{:else if modal}
<Dialog onClose={clearModals} {...modal.options}>
{#key modal.id}
<modal.component {...modal.props} />
{:else if m}
<Dialog onClose={clearModals} {...m.options}>
{#key m.id}
<m.component {...m.props} />
{/key}
</Dialog>
{/if}