aboutsummaryrefslogtreecommitdiffhomepage
path: root/td/telegram/ThemeManager.cpp
diff options
context:
space:
mode:
authorlevlam <levlam@telegram.org>2023-11-02 14:25:40 +0300
committerlevlam <levlam@telegram.org>2023-11-02 14:25:40 +0300
commit08888d5eade84f64c1f23b8c7febfbb08d05a4e4 (patch)
treebc5e57a557487dc9ffbe644a83e30c0aa41a442d /td/telegram/ThemeManager.cpp
parentab5219f546db70c6877d54f1ef7b6776a2f564cc (diff)
Don't forget old colors.
Diffstat (limited to 'td/telegram/ThemeManager.cpp')
-rw-r--r--td/telegram/ThemeManager.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/td/telegram/ThemeManager.cpp b/td/telegram/ThemeManager.cpp
index 0d143424a..eeafa142c 100644
--- a/td/telegram/ThemeManager.cpp
+++ b/td/telegram/ThemeManager.cpp
@@ -244,9 +244,6 @@ void ThemeManager::on_update_accent_colors(FlatHashMap<AccentColorId, vector<int
vector<AccentColorId> accent_color_ids) {
auto are_equal = [](const FlatHashMap<AccentColorId, vector<int32>, AccentColorIdHash> &lhs,
const FlatHashMap<AccentColorId, vector<int32>, AccentColorIdHash> &rhs) {
- if (lhs.size() != rhs.size()) {
- return false;
- }
for (auto &lhs_it : lhs) {
auto rhs_it = rhs.find(lhs_it.first);
if (rhs_it == rhs.end() || rhs_it->second != lhs_it.second) {
@@ -259,8 +256,12 @@ void ThemeManager::on_update_accent_colors(FlatHashMap<AccentColorId, vector<int
are_equal(dark_colors, accent_colors_.dark_colors_)) {
return;
}
- accent_colors_.light_colors_ = std::move(light_colors);
- accent_colors_.dark_colors_ = std::move(dark_colors);
+ for (auto &it : light_colors) {
+ accent_colors_.light_colors_[it.first] = std::move(it.second);
+ }
+ for (auto &it : dark_colors) {
+ accent_colors_.dark_colors_[it.first] = std::move(it.second);
+ }
accent_colors_.accent_color_ids_ = std::move(accent_color_ids);
}