Make dismissed reactive ($state) to clear the Svelte build warning
dismissed.size is read in the template (the History 'Clear' control), so the Set must be $state for Svelte 5 to track .add()/reassignment. Build is warning-clean again. Frontend only — rebuild + refresh. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -26,8 +26,8 @@
|
||||
const BRIEF_VIEW_KEY = 'goodnews:brief_view'; // {date, items} — the reader's curated brief
|
||||
const HISTORY_CAP = 200;
|
||||
|
||||
let seenIds = new Set();
|
||||
let dismissed = new Set();
|
||||
let seenIds = new Set(); // handler-only, not rendered — no reactivity needed
|
||||
let dismissed = $state(new Set()); // read in the template (Clear button) — must be reactive
|
||||
let history = $state([]);
|
||||
|
||||
function persistSession() {
|
||||
|
||||
Reference in New Issue
Block a user