Standardizing how things are reloaded. Triggers again!
This commit is contained in:
@@ -11,7 +11,7 @@ import { Modal } from 'flowbite-svelte';
|
||||
|
||||
import type { key_val } from '$lib/ae_stores';
|
||||
import { ae_util } from '$lib/ae_utils/ae_utils';
|
||||
import { idaa_loc, idaa_sess, idaa_slct } from '$lib/ae_idaa_stores';
|
||||
import { idaa_loc, idaa_sess, idaa_slct, idaa_trig, idaa_prom } from '$lib/ae_idaa_stores';
|
||||
// import Element_data_store from '$lib/element_data_store_v2.svelte';
|
||||
// import Comp_event_session_obj_li from '../../events_pres_mgmt/ae_comp__event_session_obj_li.svelte';
|
||||
|
||||
@@ -19,7 +19,7 @@ import { liveQuery } from "dexie";
|
||||
import { core_func } from '$lib/ae_core/ae_core_functions';
|
||||
import { db_events } from "$lib/ae_events/db_events";
|
||||
import { ae_snip, ae_loc, ae_sess, ae_api, ae_trig, slct, slct_trigger } from '$lib/ae_stores';
|
||||
// import { events_func } from '$lib/ae_events_functions';
|
||||
import { events_func } from '$lib/ae_events_functions';
|
||||
|
||||
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';
|
||||
@@ -78,6 +78,34 @@ $: lq_new__event_obj_li = liveQuery(async () => {
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$: if ($idaa_trig.event_li) {
|
||||
$idaa_trig.event_li = false;
|
||||
|
||||
if (log_lvl) {
|
||||
console.log(`Triggered: $idaa_trig.event_li`);
|
||||
}
|
||||
|
||||
if ($idaa_loc.recovery_meetings.qry__enabled !== 'all' || $idaa_loc.recovery_meetings.qry__hidden !== 'all') {
|
||||
console.log(`Deleting disabled or hidden event.`);
|
||||
let results = db_events.events
|
||||
.clear();
|
||||
console.log(`Deleted ${results} disabled event.`);
|
||||
|
||||
}
|
||||
|
||||
$idaa_prom.load__event_obj_li = events_func.load_ae_obj_li__event({
|
||||
api_cfg: $ae_api,
|
||||
for_obj_type: 'account',
|
||||
for_obj_id: $idaa_slct.account_id,
|
||||
enabled: $idaa_loc.recovery_meetings.qry__enabled,
|
||||
hidden: $idaa_loc.recovery_meetings.qry__hidden,
|
||||
limit: $idaa_loc.recovery_meetings.qry__limit,
|
||||
order_by_li: $idaa_loc.recovery_meetings.qry__order_by_li,
|
||||
try_cache: true,
|
||||
log_lvl: log_lvl,
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- ({$lq__event_obj?.event_id ?? ''}) -->
|
||||
|
||||
Reference in New Issue
Block a user