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 04edbc1c..7567d019 100644 --- a/src/routes/events/[event_id]/(launcher)/launcher_background_sync.svelte +++ b/src/routes/events/[event_id]/(launcher)/launcher_background_sync.svelte @@ -154,6 +154,17 @@ onDestroy(() => { if (timer__file_sync) clearInterval(timer__file_sync); }); +// WHY: refresh_location_config() runs on a 60s timer. Without this effect, +// switching locations leaves the new location's file list empty until the +// next timer tick. Watching event_location_id here fires an immediate fetch +// whenever the operator selects a different room. +$effect(() => { + const location_id = $events_slct.event_location_id; + if (location_id) { + refresh_location_config(); + } +}); + /** * API Refresh: Event */ @@ -440,9 +451,13 @@ async function refresh_location_config() { if (!location_id) return; try { + // WHY: inc_file_li must be true so location-level files reach Dexie. + // Without it, lq__location_event_file_obj_li in the layout finds nothing and + // the location file list in the Launcher menu never renders. await events_func.load_ae_obj_id__event_location({ api_cfg: $ae_api, event_location_id: location_id, + inc_file_li: true, try_cache: true, log_lvl: 0 });