Skip to content

Commit 856c8a6

Browse files
committed
[Perf] Default animation level: 2 → 1 (follow-up)
1 parent 7df367a commit 856c8a6

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

src/components/left/settings/SettingsPerformance.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ function SettingsPerformance({
139139
? INITIAL_PERFORMANCE_STATE_MIN
140140
: (newLevel === ANIMATION_LEVEL_MED ? INITIAL_PERFORMANCE_STATE_MED : INITIAL_PERFORMANCE_STATE_MAX);
141141

142-
setSharedSettingOption({ animationLevel: newLevel as AnimationLevel });
142+
setSharedSettingOption({ animationLevel: newLevel as AnimationLevel, wasAnimationLevelSetManually: true });
143143
updatePerformanceSettings(performance);
144144
}, []);
145145

src/global/actions/ui/settings.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ addActionHandler('updatePerformanceSettings', (global, actions, payload): Action
130130
...settings.performance,
131131
...payload,
132132
},
133+
wasAnimationLevelSetManually: true,
133134
});
134135

135136
return global;

src/global/cache.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import { encryptSession } from '../util/passcode';
3434
import { onBeforeUnload, throttle } from '../util/schedulers';
3535
import { hasStoredSession } from '../util/sessions';
3636
import { addActionHandler, getGlobal } from './index';
37-
import { INITIAL_GLOBAL_STATE } from './initialState';
37+
import { INITIAL_GLOBAL_STATE, INITIAL_PERFORMANCE_STATE_MED } from './initialState';
3838
import { clearGlobalForLockScreen, clearSharedStateForLockScreen } from './reducers';
3939
import {
4040
selectChatLastMessageId,
@@ -351,11 +351,9 @@ function unsafeMigrateCache(cached: GlobalState, initialState: GlobalState) {
351351
}
352352

353353
const cachedSharedSettings = cached.sharedState.settings;
354-
if (
355-
cachedSharedSettings.animationLevel !== ANIMATION_LEVEL_DEFAULT
356-
&& !cachedSharedSettings.wasAnimationLevelSetManually
357-
) {
354+
if (!cachedSharedSettings.wasAnimationLevelSetManually) {
358355
cachedSharedSettings.animationLevel = ANIMATION_LEVEL_DEFAULT;
356+
cachedSharedSettings.performance = INITIAL_PERFORMANCE_STATE_MED;
359357
}
360358
}
361359

0 commit comments

Comments
 (0)