diff --git a/src/components/left/main/LeftSideMenuItems.tsx b/src/components/left/main/LeftSideMenuItems.tsx index b341ada52..9b945f520 100644 --- a/src/components/left/main/LeftSideMenuItems.tsx +++ b/src/components/left/main/LeftSideMenuItems.tsx @@ -121,7 +121,7 @@ const LeftSideMenuItems = ({ ? INITIAL_PERFORMANCE_STATE_MIN : (newLevel === ANIMATION_LEVEL_MAX ? INITIAL_PERFORMANCE_STATE_MAX : INITIAL_PERFORMANCE_STATE_MED); - setSharedSettingOption({ animationLevel: newLevel as AnimationLevel }); + setSharedSettingOption({ animationLevel: newLevel as AnimationLevel, wasAnimationLevelSetManually: true }); updatePerformanceSettings(performanceSettings); }); diff --git a/src/config.ts b/src/config.ts index 58b18491d..76433ddab 100644 --- a/src/config.ts +++ b/src/config.ts @@ -166,7 +166,7 @@ export const ANIMATION_LEVEL_CUSTOM = -1; export const ANIMATION_LEVEL_MIN = 0; export const ANIMATION_LEVEL_MED = 1; export const ANIMATION_LEVEL_MAX = 2; -export const ANIMATION_LEVEL_DEFAULT = ANIMATION_LEVEL_MAX; +export const ANIMATION_LEVEL_DEFAULT = ANIMATION_LEVEL_MED; export const DEFAULT_MESSAGE_TEXT_SIZE_PX = 16; export const IOS_DEFAULT_MESSAGE_TEXT_SIZE_PX = 17; diff --git a/src/global/cache.ts b/src/global/cache.ts index 24516d365..d63359e48 100644 --- a/src/global/cache.ts +++ b/src/global/cache.ts @@ -10,7 +10,7 @@ import type { ActionReturnType, GlobalState, SharedState } from './types'; import { MAIN_THREAD_ID } from '../api/types'; import { - ALL_FOLDER_ID, + ALL_FOLDER_ID, ANIMATION_LEVEL_DEFAULT, ARCHIVED_FOLDER_ID, DEBUG, DEFAULT_LIMITS, @@ -349,6 +349,14 @@ function unsafeMigrateCache(cached: GlobalState, initialState: GlobalState) { if (!cached.messages.webPageById) { cached.messages.webPageById = initialState.messages.webPageById; } + + const cachedSharedSettings = cached.sharedState.settings; + if ( + cachedSharedSettings.animationLevel !== ANIMATION_LEVEL_DEFAULT + && !cachedSharedSettings.wasAnimationLevelSetManually + ) { + cachedSharedSettings.animationLevel = ANIMATION_LEVEL_DEFAULT; + } } function updateCache(force?: boolean) { diff --git a/src/global/types/sharedState.ts b/src/global/types/sharedState.ts index 33258ecb9..84662cf50 100644 --- a/src/global/types/sharedState.ts +++ b/src/global/types/sharedState.ts @@ -14,6 +14,8 @@ export interface SharedSettings { performance: PerformanceType; messageTextSize: number; animationLevel: AnimationLevel; + // This can be deleted after September 2025, along with the corresponding migration + wasAnimationLevelSetManually?: boolean; messageSendKeyCombo: 'enter' | 'ctrl-enter'; miniAppsCachedPosition?: Point; miniAppsCachedSize?: Size;