💄 Optimize the ability to search

This commit is contained in:
2025-10-10 00:50:17 +08:00
parent b43b70df3f
commit ac424bde36
2 changed files with 21 additions and 5 deletions

View File

@@ -130,7 +130,10 @@ class SearchMessagesScreen extends HookConsumerWidget {
// Optimized search function with debouncing
void performSearch(String query) async {
if (query.trim().isEmpty) {
final trimmedQuery = query.trim();
final hasFilters = withLinks.value || withAttachments.value;
if (trimmedQuery.isEmpty && !hasFilters) {
searchState.value = SearchState.idle;
searchResultCount.value = null;
searchResults.value = const AsyncValue.data([]);