mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 06:35:14 +00:00
Use a single Ui::UnreadStoryOutlineGradient.
This commit is contained in:
@@ -531,11 +531,37 @@ void Stories::loadMore(StorySourcesList list) {
|
||||
}
|
||||
}, [](const MTPDstories_allStoriesNotModified &) {
|
||||
});
|
||||
|
||||
preloadListsMore();
|
||||
}).fail([=] {
|
||||
_loadMoreRequestId[index] = 0;
|
||||
}).send();
|
||||
}
|
||||
|
||||
void Stories::preloadListsMore() {
|
||||
if (_loadMoreRequestId[static_cast<int>(StorySourcesList::NotHidden)]
|
||||
|| _loadMoreRequestId[static_cast<int>(StorySourcesList::Hidden)]) {
|
||||
return;
|
||||
}
|
||||
const auto loading = [&](StorySourcesList list) {
|
||||
return _loadMoreRequestId[static_cast<int>(list)] != 0;
|
||||
};
|
||||
const auto countLoaded = [&](StorySourcesList list) {
|
||||
const auto index = static_cast<int>(list);
|
||||
return _sourcesLoaded[index] || !_sourcesStates[index].isEmpty();
|
||||
};
|
||||
if (loading(StorySourcesList::NotHidden)
|
||||
|| loading(StorySourcesList::Hidden)) {
|
||||
return;
|
||||
} else if (!countLoaded(StorySourcesList::NotHidden)) {
|
||||
loadMore(StorySourcesList::NotHidden);
|
||||
} else if (!countLoaded(StorySourcesList::Hidden)) {
|
||||
loadMore(StorySourcesList::Hidden);
|
||||
} else if (!archiveCountKnown()) {
|
||||
archiveLoadMore();
|
||||
}
|
||||
}
|
||||
|
||||
void Stories::sendResolveRequests() {
|
||||
if (!_resolveSent.empty()) {
|
||||
return;
|
||||
|
Reference in New Issue
Block a user