fix(locations): auto-load locations on page open; fix session query and POC visibility
- Add +page.ts to trigger load_ae_obj_li__event_location on page load (locations were never fetched without a manual trigger) - Fix ae_comp__event_session_obj_li_wrapper: query used event_location_id_random (deprecated index) instead of event_location_id, causing empty session lists under each location - Wire hide__session_poc to pres_mgmt_loc.current.show__session_li_poc_field so the Options toggle actually takes effect in the per-location session list - Also set hide__session_location=true since location is implicit in that context Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
23
src/routes/events/[event_id]/(pres_mgmt)/locations/+page.ts
Normal file
23
src/routes/events/[event_id]/(pres_mgmt)/locations/+page.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
/** @type {import('./$types').PageLoad} */
|
||||
|
||||
import { browser } from '$app/environment';
|
||||
import { events_func } from '$lib/ae_events/ae_events_functions';
|
||||
|
||||
export async function load({ parent }) {
|
||||
const parent_data = await parent();
|
||||
|
||||
const account_id = parent_data.account_id;
|
||||
const ae_acct = parent_data[account_id];
|
||||
const event_id = ae_acct.slct.event_id;
|
||||
|
||||
if (browser && event_id) {
|
||||
events_func.load_ae_obj_li__event_location({
|
||||
api_cfg: ae_acct.api,
|
||||
for_obj_type: 'event',
|
||||
for_obj_id: event_id,
|
||||
hidden: 'all'
|
||||
});
|
||||
}
|
||||
|
||||
return parent_data;
|
||||
}
|
||||
@@ -386,6 +386,8 @@ if (!pres_mgmt_loc.current.location_kv) {
|
||||
link_to_type={'event_location'}
|
||||
link_to_id={event_location_obj?.event_location_id}
|
||||
event_session_id_random_li={[]}
|
||||
hide__session_location={true}
|
||||
hide__session_poc={!pres_mgmt_loc.current.show__session_li_poc_field}
|
||||
{log_lvl}></Comp_event_session_obj_li>
|
||||
{/if}
|
||||
{:else if pres_mgmt_loc.current.show_content__location_devices_sessions == 'devices'}
|
||||
|
||||
@@ -41,7 +41,7 @@ let lq__event_session_obj_li = $derived.by(() => {
|
||||
return liveQuery(async () => {
|
||||
if (link_to_type && link_to_id) {
|
||||
const results = await db_events.session
|
||||
.where(`${link_to_type}_id_random`)
|
||||
.where(`${link_to_type}_id`)
|
||||
.equals(link_to_id)
|
||||
.sortBy('start_datetime');
|
||||
return results;
|
||||
|
||||
Reference in New Issue
Block a user