mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-07 15:43:55 +02:00
Fix empty query migrated group search.
This commit is contained in:
parent
67a666b282
commit
ec45041a66
1 changed files with 15 additions and 1 deletions
|
@ -2520,7 +2520,19 @@ bool Widget::search(bool inCache, SearchRequestDelay delay) {
|
|||
};
|
||||
if (trimmed.isEmpty() && !fromPeer && inTags.empty()) {
|
||||
cancelSearchRequest();
|
||||
|
||||
// Otherwise inside first searchApplyEmpty we call searchMode(),
|
||||
// which tries to load migrated search results for empty query.
|
||||
_migratedProcess.full = true;
|
||||
|
||||
searchApplyEmpty(fromStartType, currentSearchProcess());
|
||||
if (_searchInMigrated) {
|
||||
const auto type = SearchRequestType{
|
||||
.migrated = true,
|
||||
.start = true,
|
||||
};
|
||||
searchApplyEmpty(type, &_migratedProcess);
|
||||
}
|
||||
if (_searchWithPostsPreview) {
|
||||
searchApplyEmpty(
|
||||
{ .posts = true, .start = true },
|
||||
|
@ -3481,7 +3493,9 @@ bool Widget::applySearchState(SearchState state) {
|
|||
: ChatSearchTab::MyMessages;
|
||||
}
|
||||
|
||||
const auto migrateFrom = (peer && !topic)
|
||||
const auto migrateFrom = (peer
|
||||
&& !topic
|
||||
&& state.tab == ChatSearchTab::ThisPeer)
|
||||
? peer->migrateFrom()
|
||||
: nullptr;
|
||||
_searchInMigrated = migrateFrom
|
||||
|
|
Loading…
Add table
Reference in a new issue