Bug fix for event_id being added as a URL param. Other fixes.
This commit is contained in:
@@ -30,8 +30,8 @@ import Element_data_store from '$lib/element_data_store_v2.svelte';
|
||||
|
||||
import Comp__event_obj_qry from './ae_idaa_comp__event_obj_qry.svelte';
|
||||
import Comp__event_obj_li from './ae_idaa_comp__event_obj_li.svelte';
|
||||
import Comp__event_obj_id_edit from './ae_idaa_comp__event_obj_id_edit.svelte';
|
||||
import Comp__event_obj_id_view from './ae_idaa_comp__event_obj_id_view.svelte';
|
||||
// import Comp__event_obj_id_edit from './ae_idaa_comp__event_obj_id_edit.svelte';
|
||||
// import Comp__event_obj_id_view from './ae_idaa_comp__event_obj_id_view.svelte';
|
||||
|
||||
|
||||
// let event_id = page.url.searchParams.get('event_id') ?? null;
|
||||
@@ -280,61 +280,11 @@ $effect(() => {
|
||||
});
|
||||
|
||||
|
||||
$effect(() => {
|
||||
if ($idaa_trig.event_id && $idaa_slct.event_id) {
|
||||
log_lvl = 1;
|
||||
$idaa_trig.event_id = false;
|
||||
|
||||
if (log_lvl) {
|
||||
console.log(`Triggered: $idaa_slct.event_id = ${$idaa_slct.event_id}`);
|
||||
}
|
||||
|
||||
$idaa_prom.load__event_obj = events_func.load_ae_obj_id__event({
|
||||
api_cfg: $ae_api,
|
||||
event_id: $idaa_slct.event_id,
|
||||
// enabled: $idaa_loc.recovery_meetings.qry__enabled,
|
||||
// hidden: $idaa_loc.recovery_meetings.qry__hidden,
|
||||
// limit: $idaa_loc.recovery_meetings.qry__limit,
|
||||
try_cache: true,
|
||||
log_lvl: log_lvl,
|
||||
})
|
||||
.then((event_obj) => {
|
||||
if (log_lvl) {
|
||||
console.log(`Event object loaded: `, event_obj);
|
||||
}
|
||||
|
||||
$idaa_slct.event_obj = event_obj;
|
||||
|
||||
// $idaa_sess.recovery_meetings.show__modal_view = $idaa_slct.event_id;
|
||||
// $idaa_sess.recovery_meetings.show__modal_edit = false;
|
||||
});
|
||||
|
||||
// $idaa_slct.event_obj = $idaa_prom.load__event_obj;
|
||||
|
||||
if (!page.url.searchParams.get('event_id')) {
|
||||
const url = new URL(location);
|
||||
url.searchParams.set('event_id', $idaa_slct.event_id);
|
||||
history.pushState({}, '', url);
|
||||
|
||||
let message = {'event_id': $idaa_slct.event_id};
|
||||
window.parent.postMessage(message, "*");
|
||||
}
|
||||
|
||||
$idaa_sess.recovery_meetings.show__modal_view = $idaa_slct.event_id;
|
||||
$idaa_sess.recovery_meetings.show__modal_view__event_id = $idaa_slct.event_id;
|
||||
$idaa_sess.recovery_meetings.show__modal_edit = false;
|
||||
$idaa_sess.recovery_meetings.show__modal_edit__event_id = false;
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
if (browser) {
|
||||
console.log('Browser environment detected.');
|
||||
|
||||
// if (!$idaa_sess.recovery_meetings.show__modal_edit && !$idaa_sess.recovery_meetings.show__modal_view__event_id) {
|
||||
// $idaa_slct.event_id = null;
|
||||
// }
|
||||
|
||||
let message = {'event_id': $idaa_slct?.event_id ?? null};
|
||||
window.parent.postMessage(message, "*");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user