From b3ca050156f10aae285d2f7bfb873d9fa43bf3f4 Mon Sep 17 00:00:00 2001 From: Joel Klinghed Date: Mon, 23 Nov 2026 13:43:23 +0100 Subject: web: fix state_referenced_locally warnings Read the session's stores through $derived instead of top-level consts, so the session prop is read reactively and the existing store-rune references keep their reactivity; make the card width/height constants derived from the scale prop; seed the transient edit buffers (note/figure note, rename fields) from props once on mount with an explicit svelte-ignore, since the menu is remounted when opened and a later prop change must not clobber an in-progress edit. Also fixes a latent bug in LootEnhancementCounter where the buttons tested !player (the store object, always truthy) instead of !$player, so the enhancement buttons were never disabled for spectators. --- web/src/lib/ui/decks/LootDeckWidget.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'web/src/lib/ui/decks/LootDeckWidget.svelte') diff --git a/web/src/lib/ui/decks/LootDeckWidget.svelte b/web/src/lib/ui/decks/LootDeckWidget.svelte index 369a6c2..1da8c6e 100644 --- a/web/src/lib/ui/decks/LootDeckWidget.svelte +++ b/web/src/lib/ui/decks/LootDeckWidget.svelte @@ -23,8 +23,8 @@ onOpenMenu: () => void; } = $props(); - const gameState = session.state; - const player = session.player; + const gameState = $derived(session.state); + const player = $derived(session.player); // Hidden while the deck is empty (the reference `shouldHide`). const hidden = $derived(deck.drawPile.length === 0 && deck.discardPile.length === 0); -- cgit v1.3.1