fix: account_name not showing on events page — stale Dexie cache + duplicate assignment

Two Svelte-side bugs causing account_name to always show 'Account Name Not Set':

1. ae_core__site.ts: background site_domain refresh only pushed cfg_json back
   into $ae_loc after a stale cache hit. Now also pushes account_name and
   account_code when the store holds a placeholder value.

2. +layout.ts: duplicate ae_loc_init['account_name'] assignment at line ~475
   was overwriting the correct one at line ~385 with a different fallback string
   ('Account Name Not Set' vs 'Ghost Account'). Removed the duplicate.

Also includes user-intentional changes during testing:
- events/+page.svelte: typo fix ('You access' -> 'Your access'); Pres Mgmt /
  Launcher / Badges / Leads buttons now gated on trusted_access && edit_mode
- events/+page.ts: event list limit 25 -> 7
- events/[event_id]/+page.svelte: user edit
This commit is contained in:
Scott Idem
2026-05-15 11:46:10 -04:00
parent 48a748d314
commit f297c7c018
5 changed files with 33 additions and 19 deletions

View File

@@ -472,8 +472,8 @@ export async function load({ fetch, params, parent, route, url }) {
// });
// }
ae_loc_init['account_name'] =
json_data.account_name || 'Account Name Not Set';
// account_name is already set above (line ~385). This was a duplicate that
// overwrote it with a different fallback string — removed.
// ae_acct['api'] = ae_api_init; // DO NOT USE: This overwrites our isolated clone from line 65
ae_acct['loc'] = ae_loc_init;

View File

@@ -88,7 +88,7 @@ onMount(() => {
</p>
{:else if !$ae_loc.trusted_access}
<h3 class="h4">Restricted Access</h3>
<p>You access to the presentation management system is limited.</p>
<p>Your access to the presentation management system is limited.</p>
{/if}
<!-- <Element_data_store
@@ -164,7 +164,7 @@ onMount(() => {
Event Home
</a>
{#if $ae_loc.trusted_access}
{#if $ae_loc.trusted_access && $ae_loc.edit_mode}
<a
href="/events/{event_obj.event_id}/pres_mgmt"
class="btn btn-sm preset-tonal-secondary border-secondary-500 hover:preset-filled-secondary-500 border"

View File

@@ -39,7 +39,7 @@ export async function load({ parent }) {
// inc_session_li: false,
hidden: 'all', // 'not_hidden'
enabled: 'enabled',
limit: 25,
limit: 7,
try_cache: true,
log_lvl: log_lvl
});

View File

@@ -24,7 +24,7 @@ const modules = [
icon: Presentation,
description: 'Manage sessions, presentations, and presenters.',
color: 'preset-filled-primary-200-800',
access: 'authenticated_access'
access: 'anonymous_access'
},
{
name: 'Launcher',
@@ -40,7 +40,7 @@ const modules = [
icon: IdCard,
description: 'Manage and print event badges.',
color: 'preset-filled-tertiary-200-800',
access: 'authenticated_access'
access: 'anonymous_access'
},
{
name: 'Leads',