Trying to make things work better...

This commit is contained in:
Scott Idem
2024-03-26 14:24:35 -04:00
parent 040e1e71e3
commit 4d486a580c
22 changed files with 508 additions and 410 deletions

View File

@@ -1,6 +1,31 @@
<script lang="ts">
/** @type {import('./$types').LayoutData} */
export let data;
export let data: any;
import { onMount } from 'svelte';
import { localStorageStore } from '@skeletonlabs/skeleton';
import { ae_loc, ae_sess, ae_api, slct, slct_trigger } from '$lib/ae_stores';
// Quickly save the data passed from the parent to the Svelte stores.
$ae_loc = data.ae_loc;
$ae_loc.mod.events.event_id = data.ae_slct.event_id;
$ae_loc.mod.events.event_obj = data.ae_slct.event_obj;
// We want to loop through all of the data store (ds) key value pairs and set them to localStorage
if (data.ae_ds) {
for (let [key, value] of Object.entries(data.ae_ds)) {
console.log(`ae_ds__ key: ${key}, value:`, value);
localStorageStore(`ae_ds__${key}`, value);
}
}
onMount(() => {
if (data.url.searchParams.get('event_id')) {
$slct.event_id = data.url.searchParams.get('event_id');
$ae_loc.mod.events.event_id = data.url.searchParams.get('event_id');
}
});
</script>