From eac9358c6f1710d202ad3859edd3581cb700b235 Mon Sep 17 00:00:00 2001 From: Admin Date: Thu, 2 Apr 2026 17:48:25 +0500 Subject: [PATCH] fix(discover): guard active card with {#if currentBook} to fix TS errors; use $state for cardEl bind --- ui/src/routes/discover/+page.svelte | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/src/routes/discover/+page.svelte b/ui/src/routes/discover/+page.svelte index 4d71835..0b0780a 100644 --- a/ui/src/routes/discover/+page.svelte +++ b/ui/src/routes/discover/+page.svelte @@ -114,7 +114,7 @@ ); const rotation = $derived(isDragging ? Math.max(-18, Math.min(18, offsetX / 12)) : 0); - let cardEl: HTMLDivElement | null = null; + let cardEl = $state(null); function onPointerDown(e: PointerEvent) { if (animating || !currentBook) return; @@ -446,6 +446,7 @@ {/if} + {#if currentBook}
NOPE
+ {/if}