feat: implement infinite mode with character selection and scoring; refactor daily character storage logic
This commit is contained in:
@@ -21,11 +21,11 @@
|
||||
|
||||
// Load from localStorage on mount
|
||||
onMount(() => {
|
||||
const storedDailyCharacterId = localStorage.getItem('currentDailyCharacterId');
|
||||
const currentDailyCharacterId = dailyCharacter?.id;
|
||||
const storedDailyCharacterId = localStorage.getItem('dailyCurrentCharacterId');
|
||||
const dailyCurrentCharacterId = dailyCharacter?.id;
|
||||
|
||||
// If the daily character has changed, clear the history
|
||||
if (storedDailyCharacterId && storedDailyCharacterId !== currentDailyCharacterId) {
|
||||
if (storedDailyCharacterId && storedDailyCharacterId !== dailyCurrentCharacterId) {
|
||||
localStorage.removeItem('dailyCharacterHistory');
|
||||
selectedCharacters = [];
|
||||
} else {
|
||||
@@ -47,8 +47,8 @@
|
||||
}
|
||||
|
||||
// Store the current daily character ID
|
||||
if (currentDailyCharacterId) {
|
||||
localStorage.setItem('currentDailyCharacterId', currentDailyCharacterId);
|
||||
if (dailyCurrentCharacterId) {
|
||||
localStorage.setItem('dailyCurrentCharacterId', dailyCurrentCharacterId);
|
||||
}
|
||||
|
||||
isLoaded = true;
|
||||
|
||||
Reference in New Issue
Block a user