mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-07 23:53:58 +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()) {
|
if (trimmed.isEmpty() && !fromPeer && inTags.empty()) {
|
||||||
cancelSearchRequest();
|
cancelSearchRequest();
|
||||||
|
|
||||||
|
// Otherwise inside first searchApplyEmpty we call searchMode(),
|
||||||
|
// which tries to load migrated search results for empty query.
|
||||||
|
_migratedProcess.full = true;
|
||||||
|
|
||||||
searchApplyEmpty(fromStartType, currentSearchProcess());
|
searchApplyEmpty(fromStartType, currentSearchProcess());
|
||||||
|
if (_searchInMigrated) {
|
||||||
|
const auto type = SearchRequestType{
|
||||||
|
.migrated = true,
|
||||||
|
.start = true,
|
||||||
|
};
|
||||||
|
searchApplyEmpty(type, &_migratedProcess);
|
||||||
|
}
|
||||||
if (_searchWithPostsPreview) {
|
if (_searchWithPostsPreview) {
|
||||||
searchApplyEmpty(
|
searchApplyEmpty(
|
||||||
{ .posts = true, .start = true },
|
{ .posts = true, .start = true },
|
||||||
|
@ -3481,7 +3493,9 @@ bool Widget::applySearchState(SearchState state) {
|
||||||
: ChatSearchTab::MyMessages;
|
: ChatSearchTab::MyMessages;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto migrateFrom = (peer && !topic)
|
const auto migrateFrom = (peer
|
||||||
|
&& !topic
|
||||||
|
&& state.tab == ChatSearchTab::ThisPeer)
|
||||||
? peer->migrateFrom()
|
? peer->migrateFrom()
|
||||||
: nullptr;
|
: nullptr;
|
||||||
_searchInMigrated = migrateFrom
|
_searchInMigrated = migrateFrom
|
||||||
|
|
Loading…
Add table
Reference in a new issue