owlboard-svelte/src/routes/ldb/+page.svelte

30 lines
650 B
Svelte
Raw Normal View History

2023-06-13 13:38:59 +01:00
<script>
2023-06-16 22:55:18 +01:00
import Header from '$lib/navigation/header.svelte'
import Nav from '$lib/navigation/nav.svelte'
import PublicLdb from '$lib/ldb/public-ldb.svelte';
import {onMount} from 'svelte'
2023-06-13 13:38:59 +01:00
2023-06-16 22:55:18 +01:00
const title = "Public Board"
async function getHeadcode() {
2023-06-13 13:38:59 +01:00
return new URLSearchParams(window.location.search).get('station');
}
2023-06-17 01:53:08 +01:00
let station;
let staff;
2023-06-14 00:43:06 +01:00
2023-06-13 13:38:59 +01:00
onMount(async () => {
2023-06-16 22:55:18 +01:00
station = await getHeadcode() || "";
2023-06-17 01:53:08 +01:00
staff = false;
2023-06-13 13:38:59 +01:00
})
</script>
2023-06-14 11:02:46 +01:00
<Header {title} />
2023-06-13 13:38:59 +01:00
2023-06-16 22:55:18 +01:00
<!-- If 'uuid' exists in store then load StaffLdb else load PublicLdb -->
2023-06-17 01:53:08 +01:00
{#if !staff}
2023-06-16 22:55:18 +01:00
<PublicLdb {station} />
2023-06-17 01:53:08 +01:00
{/if}
2023-06-13 13:38:59 +01:00
2023-06-16 22:55:18 +01:00
<Nav />