Skip to content

Commit

Permalink
TW-1923: Hide no results when search matrix ID
Browse files Browse the repository at this point in the history
  • Loading branch information
hieutbui committed Jul 22, 2024
1 parent 876cd3b commit e12cfd6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 3 additions & 1 deletion lib/pages/search/search_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,10 @@ class SearchView extends StatelessWidget {
searchController.serverSearchController.searchResultsNotifier,
builder: ((context, searchResults, child) {
if (searchResults is PresentationServerSideEmptySearch) {
final keyword = searchController.textEditingController.text;
if (searchController.searchContactAndRecentChatController!
.recentAndContactsNotifier.value.isNotEmpty) {
.recentAndContactsNotifier.value.isNotEmpty ||
(keyword.isValidMatrixId && keyword.startsWith('@'))) {
return child!;
}
return _SearchHeader(
Expand Down
8 changes: 5 additions & 3 deletions lib/pages/search/server_search_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ class ServerSearchMessagesList extends StatelessWidget {
searchController.serverSearchController.searchResultsNotifier,
builder: (context, serverSearchNotifier, child) {
if (serverSearchNotifier is PresentationServerSideEmptySearch) {
final keyword = searchController.textEditingController.text;
if (searchController.searchContactAndRecentChatController!
.recentAndContactsNotifier.value.isNotEmpty) {
return const SizedBox.shrink();
.recentAndContactsNotifier.value.isEmpty &&
!(keyword.isValidMatrixId && keyword.startsWith('@'))) {
return child!;
}
return child!;
return const SizedBox.shrink();
}

if (serverSearchNotifier is PresentationServerSideSearch) {
Expand Down

0 comments on commit e12cfd6

Please sign in to comment.