From c0254e3fe9b6802ca6d6a50f5e816ae663263236 Mon Sep 17 00:00:00 2001 From: Eric Wagoner Date: Wed, 23 Sep 2026 18:58:18 -0400 Subject: [PATCH] The hall's table selectors read from and write to the preferences, so the panel and the hall agree Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01Jm2auWk6RP71CjaAb4FMoG --- template/src/lib/components/Hall.svelte | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/template/src/lib/components/Hall.svelte b/template/src/lib/components/Hall.svelte index 0340271..5fddf62 100644 --- a/template/src/lib/components/Hall.svelte +++ b/template/src/lib/components/Hall.svelte @@ -16,13 +16,10 @@ let name = $state(playerName()); let code = $state(''); /** The host's choices for the next table, from the game's declared options. */ - // A new table starts from the preferences' table defaults, which the hall's own selectors also set. - let options = $state>( + // A new table starts from the preferences' table defaults; the hall's selectors set the same keys. + const options = $derived>( Object.fromEntries((game.options ?? []).map((o) => [o.key, o.choices.some((c) => c.value === prefs[`table.${o.key}`]) ? String(prefs[`table.${o.key}`]) : o.default])) ); - $effect(() => { - for (const o of game.options ?? []) if (prefs[`table.${o.key}`] !== options[o.key]) setPref(`table.${o.key}`, options[o.key]); - }); let prefsOpen = $state(false); let busy = $state(false); let error = $state(''); @@ -182,7 +179,7 @@