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

@@ -16,6 +16,7 @@ import { ae_loc, ae_sess, ae_api, ae_trig, slct, slct_trigger } from '$lib/ae_st
import { events_loc, events_sess, events_slct, events_trigger } from '$lib/ae_events_stores';
import { events_func } from '$lib/ae_events_functions';
// Quickly save the data passed from the parent to the Svelte stores.
$events_slct.exhibit_id = data.ae_slct.event_exhibit_id;
$events_slct.exhibit_obj = data.ae_slct.event_exhibit_obj;
$events_slct.exhibit_tracking_obj_li = data.ae_slct.event_exhibit_tracking_obj_li;
@@ -27,11 +28,7 @@ import Leads_manage from './leads_manage.svelte';
import Leads_payment from './leads_payment.svelte';
// let param_slug_event_exhibit_id = data.params.slug;
let url_passcode = data.url.searchParams.get('passcode');
if (url_passcode) {
console.log(`ae_events_leads exhibit [slug] +page.svelte: event_exhibit_id=${$events_slct.exhibit_id}; passcode=${url_passcode}`);
$events_sess.leads.entered_passcode = url_passcode;
}
let event_exhibit_obj = liveQuery(
() => db_events.exhibits.get($events_slct.exhibit_id)
@@ -89,13 +86,27 @@ onMount(() => {
}
// We need to remove the url_passcode from the URL GET params after we use it. It should be safe to assume that onMount is a safe place to do this.
let url_passcode = data.url.searchParams.get('passcode');
if (url_passcode) {
console.log(`ae_events_leads exhibit [slug] +page.svelte: event_exhibit_id=${$events_slct.exhibit_id}; passcode=${url_passcode}`);
$events_sess.leads.entered_passcode = url_passcode;
// console.log('Remove the passcode from the URL.');
data.url.searchParams.delete('passcode');
let new_url = data.url.toString()
console.log(new_url);
goto(new_url, {replaceState: true});
}
// // We need to remove the url_passcode from the URL GET params after we use it. It should be safe to assume that onMount is a safe place to do this.
// if (url_passcode) {
// // console.log('Remove the passcode from the URL.');
// data.url.searchParams.delete('passcode');
// let new_url = data.url.toString()
// console.log(new_url);
// goto(new_url, {replaceState: true});
// }
});
// console.log(`$ae_loc = `, $ae_loc);

View File

@@ -18,8 +18,6 @@ export async function load({ params, parent, url }) { // route
let event_exhibit_id = null;
if (param_slug_event_exhibit_id) {
event_exhibit_id = param_slug_event_exhibit_id;
} else if (data.url.searchParams.get('event_exhibit_id')) {
event_exhibit_id = data.url.searchParams.get('event_exhibit_id');
} else {
console.log(`The slct__event_exhibit_id was not found in the data.params.slug or data.url!!!`);
return false;