Fix modal stuff

This commit is contained in:
Jon Staab
2025-04-29 15:20:40 -07:00
parent c582082816
commit 5873e8aa60
3 changed files with 8 additions and 7 deletions
+3 -1
View File
@@ -13,6 +13,8 @@
const {next} = $props()
const nextUrl = $state.snapshot(next)
let loading = $state(false)
const enableChat = async () => {
@@ -23,7 +25,7 @@
}
clearModals()
goto(next)
goto(nextUrl)
}
const submit = async () => {
+2 -3
View File
@@ -11,19 +11,18 @@
}
const hash = $derived($page.url.hash.slice(1))
const hashIsValid = $derived(Boolean($modals[hash]))
const modal = $derived($modals[hash])
</script>
<svelte:window onkeydown={onKeyDown} />
{#if hashIsValid && modal?.options?.drawer}
{#if modal?.options?.drawer}
<Drawer onClose={clearModals} {...modal.options}>
{#key modal.id}
<modal.component {...modal.props} />
{/key}
</Drawer>
{:else if hashIsValid && modal}
{:else if modal}
<Dialog onClose={clearModals} {...modal.options}>
{#key modal.id}
<modal.component {...modal.props} />