Add bus & ferry to public ldb
This commit is contained in:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user