diff --git a/submodules/TelegramPresentationData/Sources/PresentationData.swift b/submodules/TelegramPresentationData/Sources/PresentationData.swift index abb4963d98..4a18027018 100644 --- a/submodules/TelegramPresentationData/Sources/PresentationData.swift +++ b/submodules/TelegramPresentationData/Sources/PresentationData.swift @@ -259,19 +259,7 @@ public func currentPresentationDataAndSettings(accountManager: AccountManager) - } let effectiveAccentColor = themeSettings.themeSpecificAccentColors[effectiveTheme.index]?.color ?? defaultDayAccentColor - switch effectiveTheme { - case let .builtin(reference): - switch reference { - case .dayClassic: - themeValue = defaultPresentationTheme - case .day: - themeValue = makeDefaultDayPresentationTheme(accentColor: effectiveAccentColor, serviceBackgroundColor: defaultServiceBackgroundColor) - case .night: - themeValue = makeDarkPresentationTheme(accentColor: effectiveAccentColor) - case .nightAccent: - themeValue = makeDarkAccentPresentationTheme(accentColor: effectiveAccentColor) - } - } + themeValue = makePresentationTheme(themeReference: effectiveTheme, accentColor: effectiveAccentColor, serviceBackgroundColor: defaultServiceBackgroundColor) if effectiveTheme != themeSettings.theme { switch effectiveChatWallpaper { @@ -536,20 +524,7 @@ public func updatedPresentationData(accountManager: AccountManager, applicationI let effectiveAccentColor = themeSettings.themeSpecificAccentColors[effectiveTheme.index]?.color ?? defaultDayAccentColor - let themeValue: PresentationTheme - switch effectiveTheme { - case let .builtin(reference): - switch reference { - case .dayClassic: - themeValue = makeDefaultDayPresentationTheme(serviceBackgroundColor: serviceBackgroundColor) - case .night: - themeValue = makeDarkPresentationTheme(accentColor: effectiveAccentColor) - case .nightAccent: - themeValue = makeDarkAccentPresentationTheme(accentColor: effectiveAccentColor) - case .day: - themeValue = makeDefaultDayPresentationTheme(accentColor: effectiveAccentColor, serviceBackgroundColor: serviceBackgroundColor) - } - } + let themeValue = makePresentationTheme(themeReference: effectiveTheme, accentColor: effectiveAccentColor, serviceBackgroundColor: serviceBackgroundColor) if effectiveTheme != themeSettings.theme && themeSettings.themeSpecificChatWallpapers[effectiveTheme.index] == nil { switch effectiveChatWallpaper { diff --git a/submodules/TelegramUI/TelegramUI/OpenChatMessage.swift b/submodules/TelegramUI/TelegramUI/OpenChatMessage.swift index b87f0ec0f0..746dfaf8ed 100644 --- a/submodules/TelegramUI/TelegramUI/OpenChatMessage.swift +++ b/submodules/TelegramUI/TelegramUI/OpenChatMessage.swift @@ -356,7 +356,7 @@ func openChatMessage(context: AccountContext, message: Message, standalone: Bool return nil })) case let .theme(media): - let controller = ThemePreviewController(context: context, previewTheme: makeDefaultDayPresentationTheme(accentColor: nil, serviceBackgroundColor: .black), media: .message(message: MessageReference(message), media: media)) + let controller = ThemePreviewController(context: context, previewTheme: makeDefaultDayPresentationTheme(accentColor: nil, serviceBackgroundColor: .black, day: true), media: .message(message: MessageReference(message), media: media)) present(controller, ViewControllerPresentationArguments(presentationAnimation: .modalSheet)) } }