diff --git a/src/store/authStore.ts b/src/store/authStore.ts index 69e78791..17743de9 100644 --- a/src/store/authStore.ts +++ b/src/store/authStore.ts @@ -522,6 +522,11 @@ export const useAuthStore = create()( }, onRehydrateStorage: () => (state, error) => { if (error || !state) return; + // If both hot cache and preload were enabled before mutual exclusion was enforced, reset both. + const conflictingLegacyState = + state.hotCacheEnabled && state.preloadMode !== 'off' + ? { hotCacheEnabled: false, preloadMode: 'off' as const } + : {}; useAuthStore.setState({ mixMinRatingSong: clampMixFilterMinStars(state.mixMinRatingSong as number), mixMinRatingAlbum: clampMixFilterMinStars(state.mixMinRatingAlbum as number), @@ -529,6 +534,7 @@ export const useAuthStore = create()( skipStarManualSkipCountsByKey: sanitizeSkipStarCounts( (state as { skipStarManualSkipCountsByKey?: unknown }).skipStarManualSkipCountsByKey, ), + ...conflictingLegacyState, }); }, }