Suppression des défis
Carte de l'accueil, écran des défis, calculs, textes (18 langues) et animation retirés. Les défis déjà enregistrés sont ignorés à la lecture et disparaissent à la prochaine synchro. Le journal des épisodes (episodeLog / rewatchLog) reste, déplacé dans src/lib/episodeLog.ts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YVo1qxKoBQCaMd7Ue8PGbe
This commit is contained in:
30 files changed
+54
-2433
No files matched your search
+5
-6
@@ -17,7 +17,7 @@ import { episodesPatch } from './lib/progress'
|
||||
import { uid } from './lib/utils'
|
||||
import { episodeCap } from './lib/franchise'
|
||||
import { airedCount, CACHE_EVENT } from './lib/airing'
|
||||
import { logEpisodes, mergeImportedSettings } from './lib/challenges'
|
||||
import { logEpisodes } from './lib/episodeLog'
|
||||
import { isRewatchFinish, rewatchEpisodeDelta, rewatchEpisodesPatch } from './lib/rewatch'
|
||||
|
||||
// Clés propres à l'espace actif (compte connecté, ou appareil sans compte)
|
||||
@@ -242,9 +242,9 @@ export function MediaProvider({
|
||||
getLists: () => listsRef.current,
|
||||
applyLists: (next) => setLists(() => next, true),
|
||||
getSettings: () => {
|
||||
const { ratingScale, topCategories, accentColor, themeMode, challenges, statsHiddenMonths } = settingsRef.current
|
||||
const { ratingScale, topCategories, accentColor, themeMode, statsHiddenMonths } = settingsRef.current
|
||||
// Mois masqués : liste vide plutôt qu'absente, sinon « tout réafficher » ne partirait jamais au serveur
|
||||
return { ratingScale, topCategories, accentColor, themeMode, challenges, statsHiddenMonths: statsHiddenMonths ?? [] }
|
||||
return { ratingScale, topCategories, accentColor, themeMode, statsHiddenMonths: statsHiddenMonths ?? [] }
|
||||
},
|
||||
applySettings: (patch) => updateSettingsRef.current(patch, true),
|
||||
itemsChanged: () => void reloadItems().catch(() => {}),
|
||||
@@ -285,7 +285,7 @@ export function MediaProvider({
|
||||
}, [settings.themeMode])
|
||||
|
||||
const updateSettings = useCallback((patch: Partial<Settings>, silent = false) => {
|
||||
if (!silent && syncRef.current && ('ratingScale' in patch || 'topCategories' in patch || 'accentColor' in patch || 'themeMode' in patch || 'challenges' in patch || 'statsHiddenMonths' in patch)) syncRef.current.markSettings()
|
||||
if (!silent && syncRef.current && ('ratingScale' in patch || 'topCategories' in patch || 'accentColor' in patch || 'themeMode' in patch || 'statsHiddenMonths' in patch)) syncRef.current.markSettings()
|
||||
setSettings((prev) => {
|
||||
const next = { ...prev, ...patch }
|
||||
try {
|
||||
@@ -572,12 +572,11 @@ export function MediaProvider({
|
||||
// Les réglages du compte gardent la main : les anciens ne complètent que ce qu'il n'a pas encore choisi
|
||||
const mine = normalizeSettings(readStorage(settingsKey(), {})) ?? {}
|
||||
const current = settingsRef.current
|
||||
const merged = mergeImportedSettings(oldSettings, current)
|
||||
const merged = oldSettings
|
||||
const patch: Partial<Settings> = {}
|
||||
for (const k of ['ratingScale', 'topCategories', 'accentColor', 'themeMode'] as const) {
|
||||
if (mine[k] === undefined && merged[k] !== undefined) Object.assign(patch, { [k]: merged[k] })
|
||||
}
|
||||
if (oldSettings.challenges?.length) patch.challenges = merged.challenges
|
||||
if (oldSettings.statsHiddenMonths?.length) patch.statsHiddenMonths = [...new Set([...(current.statsHiddenMonths ?? []), ...oldSettings.statsHiddenMonths])].sort()
|
||||
if (Object.keys(patch).length) updateSettings(patch)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user