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:
@@ -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 {
|
||||
|
@@ -56,6 +56,7 @@ private:
|
||||
};
|
||||
|
||||
void parseThemes(const QVector<MTPTheme> &list);
|
||||
void checkCurrentTheme();
|
||||
|
||||
void install();
|
||||
void setupReload();
|
||||
|
Reference in New Issue
Block a user