2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Generate previews async in cloud themes list.

This commit is contained in:
John Preston
2019-09-09 09:59:57 +03:00
parent 048658f838
commit eebcdb842d
7 changed files with 100 additions and 56 deletions

View File

@@ -272,6 +272,18 @@ void CloudThemes::parseThemes(const QVector<MTPTheme> &list) {
LOG(("API Error: Unexpected themeDocumentNotModified."));
});
}
checkCurrentTheme();
}
void CloudThemes::checkCurrentTheme() {
const auto &object = Window::Theme::Background()->themeObject();
if (!object.cloud.id || !object.cloud.documentId) {
return;
}
const auto i = ranges::find(_list, object.cloud.id, &CloudTheme::id);
if (i == end(_list)) {
install();
}
}
rpl::producer<> CloudThemes::updated() const {

View File

@@ -56,6 +56,7 @@ private:
};
void parseThemes(const QVector<MTPTheme> &list);
void checkCurrentTheme();
void install();
void setupReload();