[Dev] Cache: Refactor audioPlayer to use pick (#2579)

This commit is contained in:
Alexander Zinchuk 2023-02-21 18:28:04 +01:00
parent 787a9f5c93
commit 9fd73e86d6

View File

@ -275,14 +275,6 @@ function unsafeMigrateCache(cached: GlobalState, initialState: GlobalState) {
cached.customEmojis.forEmoji = {};
}
if (!cached.audioPlayer) {
cached.audioPlayer = initialState.audioPlayer;
}
if (!cached.mediaViewer) {
cached.mediaViewer = initialState.mediaViewer;
}
// TODO Remove in Jan 2023 (this was re-designed but can be hardcoded in cache)
const { light: lightTheme } = cached.settings.themes;
if (lightTheme?.patternColor === 'rgba(90, 110, 70, 0.6)' || !lightTheme?.patternColor) {
@ -398,9 +390,9 @@ export function serializeGlobal<T extends GlobalState>(global: T) {
'attachmentSettings',
'leftColumnWidth',
'lastIsChatInfoShown',
'mediaViewer',
'audioPlayer',
]),
audioPlayer: global.audioPlayer,
mediaViewer: global.mediaViewer,
customEmojis: reduceCustomEmojis(global),
users: reduceUsers(global),
chats: reduceChats(global),