Drop the high score wipe; scores leave only by being beaten

The table was clearable behind a confirm. It should not be: a stand
earns its place and loses it only to a better summer, so the control
and clearScores() are gone and the screen says so.
This commit is contained in:
2026-09-08 15:32:31 -07:00
parent 71cbb02353
commit 175589223a
4 changed files with 12 additions and 35 deletions
+5 -10
View File
@@ -67,7 +67,11 @@ const newId = () =>
? crypto.randomUUID()
: `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`
/** Returns the saved table and the ids of the entries this call added. */
/**
* Returns the saved table and the ids of the entries this call added. The
* table only ever loses a row by being pushed past MAX_SCORES by a better
* one - there is no way to clear it.
*/
export function addScores(entries: NewScore[]): { table: Score[]; added: string[] } {
const at = Date.now()
const fresh: Score[] = entries.map((e) => ({ ...e, id: newId(), at }))
@@ -76,12 +80,3 @@ export function addScores(entries: NewScore[]): { table: Score[]; added: string[
const kept = new Set(table.map((s) => s.id))
return { table, added: fresh.filter((s) => kept.has(s.id)).map((s) => s.id) }
}
export function clearScores(): Score[] {
try {
window.localStorage.removeItem(KEY)
} catch {
// Ignored - the table is rendered from the return value either way.
}
return []
}