diff --git a/src/lib/core/progress-store.js b/src/lib/core/progress-store.js index 372f60c..dbd7e17 100644 --- a/src/lib/core/progress-store.js +++ b/src/lib/core/progress-store.js @@ -46,6 +46,14 @@ export const progressStore = { return Object.keys(readRaw().completed).length; }, + /** + * Returns the full progress snapshot. Lets callers read many levels + * without paying for one parse + one localStorage read per query. + */ + snapshot() { + return readRaw(); + }, + reset() { writeRaw({ completed: {}, bestMoves: {} }); } diff --git a/src/views/GameView.svelte b/src/views/GameView.svelte index a548fdf..c655d2f 100644 --- a/src/views/GameView.svelte +++ b/src/views/GameView.svelte @@ -97,6 +97,9 @@ let lastKeyAt = 0; function onKey(e) { + // Don't route gameplay keys while the donate modal is open — its own + // Escape handler should be the only consumer. + if (donateOpen) return; if (e.key === 'Escape') { onLevels(); return; } if (e.key === 'r' || e.key === 'R') { restart(); return; } if (e.key === 'u' || e.key === 'U' || e.key === 'z' || e.key === 'Z') { undo(); return; } @@ -181,8 +184,8 @@ {#if won}