RiddleHintPage

This commit is contained in:
LionTion committed 2026-10-11 19:50:10 +02:00
1 parent 4a6a9595d4
commit 662d8023bb
18 files changed
+212 -17

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
import { PREF } from "./const";
export function addBoughtHint(id: number) {
const hints = getBoughtHints();
if (hints.includes(id)) {
return;
}
hints.push(id)
localStorage.setItem(PREF.boughtHints, JSON.stringify(hints));
window.dispatchEvent(new Event('storage'));
}
export function getBoughtHints(): number[] {
const hintsList = localStorage.getItem(PREF.boughtHints);
if (hintsList === null) {
return [];
}
return JSON.parse(hintsList);
}