mirror of
https://hubproxy.babadafafafafa.cn/https://github.com/telegramdesktop/tdesktop
synced 2026-09-21 00:23:56 +08:00
Push new saved theme to the list.
This commit is contained in:
@@ -282,11 +282,14 @@ const std::vector<CloudTheme> &CloudThemes::list() const {
|
||||
return _list;
|
||||
}
|
||||
|
||||
void CloudThemes::apply(const CloudTheme &theme) {
|
||||
void CloudThemes::savedFromEditor(const CloudTheme &theme) {
|
||||
const auto i = ranges::find(_list, theme.id, &CloudTheme::id);
|
||||
if (i != end(_list)) {
|
||||
*i = theme;
|
||||
_updates.fire({});
|
||||
} else {
|
||||
_list.insert(begin(_list), theme);
|
||||
_updates.fire({});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user