From 2e57a88b05b91bdcd4179bcabe94ed7ec2a013ee Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Sun, 17 Nov 2019 22:55:08 +0400 Subject: [PATCH] Reset custom bubble color when picking one of default accent colors --- .../SettingsUI/Sources/Themes/ThemeSettingsController.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/submodules/SettingsUI/Sources/Themes/ThemeSettingsController.swift b/submodules/SettingsUI/Sources/Themes/ThemeSettingsController.swift index b2a0fff4c2..239cfbe386 100644 --- a/submodules/SettingsUI/Sources/Themes/ThemeSettingsController.swift +++ b/submodules/SettingsUI/Sources/Themes/ThemeSettingsController.swift @@ -454,14 +454,16 @@ public func themeSettingsController(context: AccountContext, focusOnItemTag: The var themeSpecificChatWallpapers = current.themeSpecificChatWallpapers var themeSpecificAccentColors = current.themeSpecificAccentColors + var themeSpecificBubbleColors = current.themeSpecificBubbleColors themeSpecificAccentColors[currentTheme.index] = color + themeSpecificBubbleColors[currentTheme.index] = nil if let wallpaper = current.themeSpecificChatWallpapers[currentTheme.index], wallpaper.hasWallpaper { } else { themeSpecificChatWallpapers[currentTheme.index] = theme.chat.defaultWallpaper } - return PresentationThemeSettings(theme: current.theme, themeSpecificAccentColors: themeSpecificAccentColors, themeSpecificBubbleColors: current.themeSpecificBubbleColors, themeSpecificChatWallpapers: themeSpecificChatWallpapers, fontSize: current.fontSize, automaticThemeSwitchSetting: current.automaticThemeSwitchSetting, largeEmoji: current.largeEmoji, disableAnimations: current.disableAnimations) + return PresentationThemeSettings(theme: current.theme, themeSpecificAccentColors: themeSpecificAccentColors, themeSpecificBubbleColors: themeSpecificBubbleColors, themeSpecificChatWallpapers: themeSpecificChatWallpapers, fontSize: current.fontSize, automaticThemeSwitchSetting: current.automaticThemeSwitchSetting, largeEmoji: current.largeEmoji, disableAnimations: current.disableAnimations) }).start() }, openAccentColorPicker: { themeReference in let controller = ThemeAccentColorController(context: context, themeReference: themeReference, section: .accent)