mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-16 19:30:29 +00:00
Fix theme switching when auto-night mode is triggered
This commit is contained in:
parent
f628ae8d6b
commit
83e58d307a
@ -584,7 +584,13 @@ public func themeSettingsController(context: AccountContext, focusOnItemTag: The
|
|||||||
moreImpl?()
|
moreImpl?()
|
||||||
})
|
})
|
||||||
|
|
||||||
let defaultThemes: [PresentationThemeReference] = [.builtin(.dayClassic), .builtin(.day), .builtin(.night), .builtin(.nightAccent)]
|
var defaultThemes: [PresentationThemeReference] = []
|
||||||
|
if presentationData.autoNightModeTriggered {
|
||||||
|
} else {
|
||||||
|
defaultThemes.append(contentsOf: [.builtin(.dayClassic), .builtin(.day)])
|
||||||
|
}
|
||||||
|
defaultThemes.append(contentsOf: [.builtin(.night), .builtin(.nightAccent)])
|
||||||
|
|
||||||
let cloudThemes: [PresentationThemeReference] = cloudThemes.map { .cloud(PresentationCloudTheme(theme: $0, resolvedWallpaper: nil)) }
|
let cloudThemes: [PresentationThemeReference] = cloudThemes.map { .cloud(PresentationCloudTheme(theme: $0, resolvedWallpaper: nil)) }
|
||||||
|
|
||||||
var availableThemes = defaultThemes
|
var availableThemes = defaultThemes
|
||||||
@ -667,7 +673,7 @@ public func themeSettingsController(context: AccountContext, focusOnItemTag: The
|
|||||||
chatWallpaper = resolvedWallpaper ?? presentationTheme.chat.defaultWallpaper
|
chatWallpaper = resolvedWallpaper ?? presentationTheme.chat.defaultWallpaper
|
||||||
}
|
}
|
||||||
|
|
||||||
return PresentationThemeSettings(chatWallpaper: chatWallpaper, theme: theme, themeSpecificAccentColors: current.themeSpecificAccentColors, themeSpecificChatWallpapers: current.themeSpecificChatWallpapers, fontSize: current.fontSize, automaticThemeSwitchSetting: current.automaticThemeSwitchSetting, largeEmoji: current.largeEmoji, disableAnimations: current.disableAnimations)
|
return PresentationThemeSettings(chatWallpaper: chatWallpaper, theme: theme, themeSpecificAccentColors: current.themeSpecificAccentColors, themeSpecificChatWallpapers: current.themeSpecificChatWallpapers, fontSize: current.fontSize, automaticThemeSwitchSetting: automaticThemeSwitchSetting, largeEmoji: current.largeEmoji, disableAnimations: current.disableAnimations)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}).start()
|
}).start()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user