Add theme customization and winner management features
Introduced a theme selection feature, allowing users to customize the application's appearance, with themes stored per user. Added functionality to manage and store the game's winner locally. These changes improve user experience and personalization.
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
function winnerKey(gameId) {
|
||||
return `winner:${gameId}`;
|
||||
}
|
||||
|
||||
export function getWinner(gameId) {
|
||||
if (!gameId) return "";
|
||||
try {
|
||||
return localStorage.getItem(winnerKey(gameId)) || "";
|
||||
} catch {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
export function setWinner(gameId, name) {
|
||||
if (!gameId) return;
|
||||
try {
|
||||
localStorage.setItem(winnerKey(gameId), name || "");
|
||||
} catch {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user