From e7895cee075a9996b72ee0071148c05a2951c7dc Mon Sep 17 00:00:00 2001 From: Scott Idem Date: Sun, 8 Feb 2026 23:17:47 -0500 Subject: [PATCH] Fix Exhibit Licensee list parsing and standardize terminology - Hardened 'Comp_exhibit_license_list' to handle both raw JSON and IDB object formats. - Updated all labels to 'Licensed Leads User' or 'Licensee' for consistency. - Verified Admin-only restriction for the licensee management section. - Fixed silent parsing failures that caused empty staff lists. --- .../ae_comp__exhibit_license_list.svelte | 17 +++++++++++++++-- .../exhibit/[exhibit_id]/ae_tab__manage.svelte | 4 ++-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/routes/events/[event_id]/(leads)/leads/exhibit/[exhibit_id]/ae_comp__exhibit_license_list.svelte b/src/routes/events/[event_id]/(leads)/leads/exhibit/[exhibit_id]/ae_comp__exhibit_license_list.svelte index 8f66996c..2e4a86b0 100644 --- a/src/routes/events/[event_id]/(leads)/leads/exhibit/[exhibit_id]/ae_comp__exhibit_license_list.svelte +++ b/src/routes/events/[event_id]/(leads)/leads/exhibit/[exhibit_id]/ae_comp__exhibit_license_list.svelte @@ -23,7 +23,20 @@ // Parse JSON into local state $effect(() => { try { - const parsed = JSON.parse(license_li_json || '[]'); + const raw = license_li_json; + if (!raw) { + untrack(() => local_license_li = []); + return; + } + + // Handle both string and pre-parsed array/object formats + let parsed = []; + if (Array.isArray(raw)) { + parsed = raw; + } else if (typeof raw === 'string') { + parsed = JSON.parse(raw || '[]'); + } + untrack(() => { local_license_li = Array.isArray(parsed) ? parsed : []; }); @@ -141,7 +154,7 @@ onclick={add_license} disabled={local_license_li.length >= (license_max || 1)} > - Add Staff License + Add Leads Licensee