Add bus & ferry to public ldb

This commit is contained in:
Fred Boniface
2023-06-19 14:21:17 +01:00
parent 3c191c4793
commit 7df190220f
7 changed files with 200 additions and 63 deletions

View File

@@ -6,23 +6,25 @@
import { uuid } from '$lib/stores/uuid.js';
import {onMount} from 'svelte'
const title = "Public Board"
let title = "Loading"
async function getHeadcode() {
return new URLSearchParams(window.location.search).get('station');
}
let station;
let staff;
let uuidValue;
let station = "";
let staff = false;
let uuidValue = "";
$: uuidValue = $uuid;
onMount(async () => {
station = await getHeadcode() || "";
if (uuidValue !== null) {
if (uuidValue !== null && uuidValue !== "" && uuidValue !== "null") {
staff = true;
title = "Staff Board"
} else {
staff = false;
title = "Public Board"
}
})
@@ -32,7 +34,7 @@
<!-- If 'uuid' exists in store then load StaffLdb else load PublicLdb -->
{#if !staff}
<PublicLdb {station} />
<PublicLdb {station} bind:title={title} />
{:else}
<StaffLdb {station} />
{/if}