flotilla/src/routes/chat/[chat]/+page.svelte

18 lines
528 B
Svelte
Raw Normal View History

2024-10-08 18:39:16 +00:00
<script lang="ts">
import {page} from "$app/stores"
2025-10-13 20:35:02 +00:00
import type {MakeNonOptional} from '@welshman/lib'
2024-10-23 16:45:06 +00:00
import Chat from "@app/components/Chat.svelte"
import {notifications, setChecked} from "@app/util/notifications"
2024-11-14 16:33:11 +00:00
2025-10-13 20:35:02 +00:00
const {chat} = $page.params as MakeNonOptional<typeof $page.params>
// We have to watch this one, since on mobile the badge will be visible when active
$effect(() => {
if ($notifications.has($page.url.pathname)) {
setChecked($page.url.pathname)
}
2024-11-14 16:33:11 +00:00
})
2024-10-08 18:39:16 +00:00
</script>
2025-10-13 20:35:02 +00:00
<Chat id={chat} />