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

43 lines
1.1 KiB
Svelte
Raw Normal View History

2023-06-13 13:38:59 +01:00
<script>
2023-07-07 11:27:28 +01:00
import Header from '$lib/navigation/header.svelte';
import Nav from '$lib/navigation/nav-ldb.svelte';
import PublicLdb from '$lib/ldb/public-ldb.svelte';
2023-07-07 21:59:06 +01:00
import StaffLdb from '$lib/ldb/staff/staff-ldb.svelte';
2023-07-07 11:27:28 +01:00
import { uuid } from '$lib/stores/uuid.js';
import { onMount } from 'svelte';
let title = 'Loading';
async function getHeadcode() {
return new URLSearchParams(window.location.search).get('station');
}
let station = '';
let staff = false;
let uuidValue = '';
$: uuidValue = $uuid;
onMount(async () => {
station = (await getHeadcode()) || '';
if (uuidValue !== null && uuidValue !== '' && uuidValue !== 'null') {
staff = true;
title = 'Staff Board';
} else {
title = 'Public Board';
2023-06-13 13:38:59 +01:00
}
2023-07-07 11:27:28 +01:00
});
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-07-07 11:27:28 +01:00
<PublicLdb {station} bind:title />
{:else}
2023-07-07 11:27:28 +01:00
<StaffLdb {station} bind:title />
<!--<StaffLdb {station} bind:title={title} /> -- Temporary, Disable StaffLdb - it isn't implemented -->
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 />