fix: Resolve badge search reactivity and SSR issues

This commit fixes several issues with the new badge search functionality. It resolves a 500 Internal Error by moving the Dexie liveQuery into an onMount block to prevent server-side execution. It also fixes a Svelte 5 reactivity issue by using a more explicit subscription pattern for the liveQuery and by correctly accessing state variables in the template. The badge search results are now correctly displayed.
This commit is contained in:
Scott Idem
2025-11-18 17:30:57 -05:00
parent d678f97324
commit 69c34fa4bc
11 changed files with 117 additions and 191 deletions

View File

@@ -48,7 +48,7 @@
if (log_lvl) {
console.log(`*** LiveQuery: lq__event_badge_obj *** event_badge_id=${event_badge_id}`);
}
let results = await db_events.badge.get(event_badge_id);
let results = await db_events.badge.where('event_badge_id').equals(event_badge_id).first();
return results;
})

View File

@@ -0,0 +1,7 @@
<script lang="ts">
// Page for printing badges
</script>
<h1 class="h1">Print Badges</h1>
<p>This page will be used for printing badges.</p>

View File

@@ -0,0 +1,7 @@
<script lang="ts">
// Page for reviewing badges
</script>
<h1 class="h1">Review Badges</h1>
<p>This page will be used for reviewing badges.</p>