fix: search results were filtered accidentally (#7196)

This commit is contained in:
Lucas
2025-01-13 14:34:23 +08:00
committed by GitHub
parent 6173022a15
commit aa9f285f59

View File

@ -57,11 +57,11 @@ impl SearchHandler for DocumentSearchHandler {
// Grab all views from folder cache
// Notice that `get_all_view_pb` returns Views that don't include trashed and private views
let mut views = self.folder_manager.get_all_views_pb().await?.into_iter();
let views = self.folder_manager.get_all_views_pb().await?;
let mut search_results: Vec<SearchResultPB> = vec![];
for result in results {
if let Some(view) = views.find(|v| v.id == result.object_id) {
if let Some(view) = views.iter().find(|v| v.id == result.object_id) {
// If there is no View for the result, we don't add it to the results
// If possible we will extract the icon to display for the result
let icon: Option<ResultIconPB> = match view.icon.clone() {