Trying to make things work better...
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user