Slowly updating things to Data Store v3. Also doing some safe code clean up. Mainly removing commented out code.
This commit is contained in:
@@ -41,8 +41,6 @@
|
||||
|
||||
import Archive_obj_id_edit from './ae_idaa_comp__archive_obj_id_edit.svelte';
|
||||
import Archive_view from './ae_idaa_comp__archive_obj_id_view.svelte';
|
||||
// import Archive_page_menu from './session_page_menu.svelte';
|
||||
// import Element_data_store from '$lib/element_data_store_v2.svelte';
|
||||
|
||||
import Archive_content_obj_li from './ae_idaa_comp__archive_content_obj_li.svelte';
|
||||
import Archive_content_obj_id_edit from './ae_idaa_comp__archive_content_obj_id_edit.svelte';
|
||||
@@ -54,17 +52,6 @@
|
||||
// let ae_tmp: key_val = {};
|
||||
// let ae_triggers: key_val = {};
|
||||
|
||||
// Variables
|
||||
|
||||
// let archive_content_id = page.url.searchParams.get('archive_content_id') ?? null;
|
||||
// if (!archive_content_id) {
|
||||
// $idaa_slct.archive_content_id = null;
|
||||
// } else {
|
||||
// console.log(`ae Archives - [archive_content_id] +page.ts: archive_content_id = `, archive_content_id);
|
||||
// $idaa_slct.archive_content_id = archive_content_id;
|
||||
// $idaa_trig.archive_content_id = archive_content_id;
|
||||
// }
|
||||
|
||||
// *** Quickly pull out data from parent(s)
|
||||
let ae_acct = data[$slct.account_id];
|
||||
if (log_lvl) {
|
||||
|
||||
@@ -26,14 +26,14 @@
|
||||
} from '$lib/stores/ae_stores';
|
||||
import { events_func } from '$lib/ae_events_functions';
|
||||
|
||||
import Element_data_store from '$lib/elements/element_data_store_v2.svelte';
|
||||
import Element_data_store from '$lib/elements/element_data_store_v3.svelte';
|
||||
import Comp__event_obj_qry from './ae_idaa_comp__event_obj_qry.svelte';
|
||||
import Comp__event_obj_li_wrapper from './ae_idaa_comp__event_obj_li_wrapper.svelte';
|
||||
|
||||
if (browser) {
|
||||
$idaa_slct.event_id = null;
|
||||
window.parent.postMessage({ event_id: null }, '*');
|
||||
|
||||
|
||||
// Use versioning instead of boolean to avoid loops
|
||||
if ($idaa_loc.recovery_meetings.search_version === undefined) {
|
||||
$idaa_loc.recovery_meetings.search_version = 0;
|
||||
@@ -79,16 +79,16 @@
|
||||
const current_search_id = ++last_search_id;
|
||||
const account_id = $ae_loc.account_id;
|
||||
const remote_first = $idaa_loc.recovery_meetings.qry__remote_first;
|
||||
|
||||
|
||||
if (log_lvl) console.log(`[Search #${current_search_id}] Refreshing recovery meetings (remote_first=${remote_first}) for account: ${account_id}...`);
|
||||
|
||||
|
||||
$idaa_sess.recovery_meetings.qry__status = 'loading';
|
||||
|
||||
|
||||
// If remote first, clear immediately to show fresh state
|
||||
if (remote_first) {
|
||||
event_id_random_li = [];
|
||||
}
|
||||
|
||||
|
||||
// Snapshot current params to ensure Fast Path matches revalidation
|
||||
const qry_str = ($idaa_loc.recovery_meetings.qry__fulltext_str ?? '').toLowerCase().trim();
|
||||
const qry_physical = $idaa_loc.recovery_meetings.qry__physical;
|
||||
@@ -141,7 +141,7 @@
|
||||
if (current_search_id === last_search_id) {
|
||||
if (log_lvl) console.log(`[Search #${current_search_id}] Fast Path complete. Found ${local_ids.length} items locally.`);
|
||||
event_id_random_li = local_ids;
|
||||
// If we found results locally, we can mark as done to stop spinning,
|
||||
// If we found results locally, we can mark as done to stop spinning,
|
||||
// revalidation will still finish in background
|
||||
if (local_ids.length > 0) {
|
||||
$idaa_sess.recovery_meetings.qry__status = 'done';
|
||||
@@ -174,7 +174,7 @@
|
||||
if (current_search_id === last_search_id) {
|
||||
const api_results = results || [];
|
||||
const api_ids = api_results.map((e: any) => e.id || e.event_id_random).filter(Boolean);
|
||||
|
||||
|
||||
// If API returns 0 but local search found broad results, protect the UI
|
||||
if (api_ids.length === 0 && local_ids.length > 0 && !remote_first && !qry_str) {
|
||||
if (log_lvl) console.warn(`[Search #${current_search_id}] Revalidation returned 0. Preserving cache.`);
|
||||
|
||||
@@ -20,14 +20,7 @@
|
||||
} from '$lib/stores/ae_stores';
|
||||
import { core_func } from '$lib/ae_core/ae_core_functions';
|
||||
import { idaa_loc, idaa_sess, idaa_slct } from '$lib/stores/ae_idaa_stores';
|
||||
import Element_data_store from '$lib/elements/element_data_store_v2.svelte';
|
||||
|
||||
// const modalRegistry: Record<string, ModalComponent> = {
|
||||
// // Set a unique modal ID, then pass the component reference
|
||||
// // modalComponentEditSponsorshipObj: { ref: ModalComponentEditSponsorshipObj },
|
||||
// // modalComponentTwo: { ref: ModalComponentTwo },
|
||||
// // ...
|
||||
// };
|
||||
import Element_data_store from '$lib/elements/element_data_store_v3.svelte';
|
||||
|
||||
interface Props {
|
||||
/** @type {import('./$types').LayoutData} */
|
||||
@@ -37,13 +30,6 @@
|
||||
|
||||
let { data, children }: Props = $props();
|
||||
|
||||
// if (browser) {
|
||||
// add_activity_log({
|
||||
// action: 'idaa_root_layout',
|
||||
// action_with: 'browser'
|
||||
// });
|
||||
// }
|
||||
|
||||
function add_activity_log({
|
||||
action = 'idaa_root_layout',
|
||||
action_with = 'none'
|
||||
@@ -179,15 +165,6 @@
|
||||
// });
|
||||
});
|
||||
|
||||
// if (browser) {
|
||||
// $idaa_loc.novi_uuid = data.params.uuid;
|
||||
// $idaa_loc.novi_email = decodeURIComponent(data.params.email);
|
||||
// $idaa_loc.novi_full_name = decodeURIComponent(data.params.full_name);
|
||||
// // $idaa_loc.novi_admin_li = novi_admin_li;
|
||||
// // $idaa_loc.novi_trusted_li = novi_trusted_li;
|
||||
// console.log(`$idaa_loc.novi_uuid:`, $idaa_loc.novi_uuid);
|
||||
// }
|
||||
|
||||
let iframe = data.url.searchParams.get('iframe');
|
||||
if (browser && iframe == 'true') {
|
||||
console.log('Use iframe layout!');
|
||||
|
||||
Reference in New Issue
Block a user