Fix infinite hydration loop and stabilize global store synchronization

- Refactored layouts to derive account data from stable props instead of reactive stores.
- Wrapped store updates in untrack() with deep equality guards to prevent infinite re-renders.
- Resolved duplicate untrack declarations and missing imports across the project.
- Added fetch safeguards to Element_data_store to prevent redundant API calls.
- Standardized hydration patterns to break circular dependencies during initial load.
This commit is contained in:
Scott Idem
2026-02-08 17:15:20 -05:00
parent 88bc18cf15
commit 718de1457d
33 changed files with 455 additions and 1567 deletions

View File

@@ -51,7 +51,7 @@
}
// Quickly save the data passed from the parent(s) to the Svelte stores, localStorage, and other.
let ae_acct = data[$slct.account_id];
let ae_acct = data[data.account_id];
$ae_loc.url_origin = data.url.origin;

View File

@@ -55,7 +55,7 @@
// Quickly save the data passed from the parent(s) to the Svelte stores, localStorage, and other.
// $slct.account_id = data.account_id;
// console.log(`$slct.account_id = `, $slct.account_id);
let ae_acct = data[$slct.account_id];
let ae_acct = data[data.account_id];
// console.log(`ae_acct = `, ae_acct);
$ae_loc.url_origin = data.url.origin;

View File

@@ -46,7 +46,7 @@
// Variables
// Quickly save the data passed from the parent(s) to the Svelte stores, localStorage, and other.
// $slct.account_id = data.account_id;
let ae_acct = data[$slct.account_id];
let ae_acct = data[data.account_id];
if (log_lvl) {
console.log(`ae_acct = `, ae_acct);
}

View File

@@ -42,7 +42,7 @@
// Quickly save the data passed from the parent(s) to the Svelte stores, localStorage, and other.
// $slct.account_id = data.account_id;
console.log(`$slct.account_id = `, $slct.account_id);
let ae_acct = data[$slct.account_id];
let ae_acct = data[data.account_id];
console.log(`ae_acct = `, ae_acct);
// console.log(`TEST data`, data);

View File

@@ -1,4 +1,5 @@
<script lang="ts">
import { untrack } from 'svelte';
interface Props {
/** @type {import('./$types').PageData} */
data: any;
@@ -58,7 +59,7 @@
// Quickly save the data passed from the parent(s) to the Svelte stores, localStorage, and other.
// $slct.account_id = data.account_id;
// console.log(`$slct.account_id = `, $slct.account_id);
let ae_acct = data[$slct.account_id];
let ae_acct = data[data.account_id];
// console.log(`ae_acct = `, ae_acct);
$ae_loc.url_origin = data.url.origin;
@@ -155,18 +156,13 @@
// JSON formatted configuration options for an event, and specifically for the presentation management module.
$effect(() => {
if ($lq__event_obj?.mod_pres_mgmt_json) {
// if (log_lvl) {
// console.log(`*** Event Pres Mgmt JSON *** pres_mgmt_cfg_local`, $events_loc.pres_mgmt);
// }
// $events_loc.pres_mgmt =
events_func.sync_config__event_pres_mgmt({
pres_mgmt_cfg_remote: $lq__event_obj?.mod_pres_mgmt_json,
pres_mgmt_cfg_local: $events_loc?.pres_mgmt,
log_lvl: log_lvl
untrack(() => {
events_func.sync_config__event_pres_mgmt({
pres_mgmt_cfg_remote: $lq__event_obj?.mod_pres_mgmt_json,
pres_mgmt_cfg_local: $events_loc?.pres_mgmt,
log_lvl: log_lvl
});
});
// if (log_lvl) {
// console.log(`*** Event Pres Mgmt JSON *** pres_mgmt_cfg_local`, $events_loc.pres_mgmt);
// }
}
});