diff --git a/src/routes/+layout.ts b/src/routes/+layout.ts index f1b581af..1fa24771 100644 --- a/src/routes/+layout.ts +++ b/src/routes/+layout.ts @@ -140,13 +140,32 @@ export async function load({ fetch, params, parent, route, url }) { site_domain_id: native_device_config.site_domain_id || native_device_config.site_domain_id_random, }; - // Inject native device metadata into the location state + // Inject native device metadata into the location state with SAFE MERGE if (native_device_config.native_device) { - ae_loc_init['native_device'] = native_device_config.native_device; + const incoming_dev = native_device_config.native_device; + + // 1. Recover existing user overrides from localStorage + let existing_dev = {}; + try { + const raw = localStorage.getItem('ae_loc'); + if (raw) existing_dev = JSON.parse(raw).native_device || {}; + } catch (e) {} + + // 2. Merge: Priority to EXISTING overrides for specific timers + ae_loc_init['native_device'] = { + ...incoming_dev, + // Persist these specific user-controlled fields + check_event_loop_period: (existing_dev as any).check_event_loop_period || incoming_dev.check_event_loop_period, + check_event_device_loop_period: (existing_dev as any).check_event_device_loop_period || incoming_dev.check_event_device_loop_period, + check_event_location_loop_period: (existing_dev as any).check_event_location_loop_period || incoming_dev.check_event_location_loop_period, + check_event_session_loop_period: (existing_dev as any).check_event_session_loop_period || incoming_dev.check_event_session_loop_period, + hash_prefix_length: (existing_dev as any).hash_prefix_length || incoming_dev.hash_prefix_length + }; + // Map specific operational paths - ae_loc_init['local_file_cache_path'] = native_device_config.native_device.local_file_cache_path; - ae_loc_init['host_file_temp_path'] = native_device_config.native_device.host_file_temp_path; - ae_loc_init['recording_path'] = native_device_config.native_device.recording_path; + ae_loc_init['local_file_cache_path'] = incoming_dev.local_file_cache_path; + ae_loc_init['host_file_temp_path'] = incoming_dev.host_file_temp_path; + ae_loc_init['recording_path'] = incoming_dev.recording_path; } // IMPORTANT: Update API settings with the native-authorized key if present diff --git a/src/routes/events/[event_id]/(launcher)/launcher_background_sync.svelte b/src/routes/events/[event_id]/(launcher)/launcher_background_sync.svelte index 4277bfaa..21b2cf9f 100644 --- a/src/routes/events/[event_id]/(launcher)/launcher_background_sync.svelte +++ b/src/routes/events/[event_id]/(launcher)/launcher_background_sync.svelte @@ -1,8 +1,7 @@ -{#if currently_syncing && log_lvl} -
-
- -
- Syncing Room Files... - {currently_syncing} - Room Status: {sync_stats.cached}/{sync_stats.total} Ready + +
+ {#if show_monitor} +
+
+ NATIVE SYNC MONITOR + +
+ +
+ Room Status: + {sync_stats.cached} / {sync_stats.total} Files + + Prefix Len: + {$ae_loc.native_device?.hash_prefix_length || 2} chars +
+ +
+
+ Event Loop: + {loop_info.event / 1000}s +
+
+ Device Loop: + {loop_info.device / 1000}s +
+
+ Location Loop: + {loop_info.location / 1000}s +
+
+ Session Loop: + {loop_info.session / 1000}s +
-
-{/if} \ No newline at end of file + {/if} + + {#if currently_syncing} + + {:else} + + + {/if} +
\ No newline at end of file diff --git a/src/routes/events/[event_id]/(launcher)/launcher_cfg.svelte b/src/routes/events/[event_id]/(launcher)/launcher_cfg.svelte index ccb2fb09..611494ea 100644 --- a/src/routes/events/[event_id]/(launcher)/launcher_cfg.svelte +++ b/src/routes/events/[event_id]/(launcher)/launcher_cfg.svelte @@ -116,6 +116,86 @@
+ + +
+

+ +

+ +
+ {#if $ae_loc.native_device} + + + + + +
+ * Prefix: {($ae_loc.native_device.hash_prefix_length || 2)} chars. Reload required. +
+ {:else} +
No device config hydrated.
+ {/if} +
+
{/if}