Push new saved theme to the list.

This commit is contained in:
John Preston
2019-09-08 21:01:45 +03:00
parent bb7018424a
commit 2ab2eed633
3 changed files with 6 additions and 3 deletions

View File

@@ -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({});
}
}