Skip to content

Commit

Permalink
ensure bookmarks can be shown in top hits
Browse files Browse the repository at this point in the history
  • Loading branch information
brindy committed May 10, 2024
1 parent 72be4e7 commit 8c44b25
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Sources/Suggestions/SuggestionProcessing.swift
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,18 @@ final class SuggestionProcessing {
if case .bookmark = $0, $0.url?.naked == nakedUrl { return true }
return false
}), case let Suggestion.bookmark(title: title, url: url, isFavorite: isFavorite, allowedInTopHits: _) = newSuggestion {
#if os(macOS)
// Copy allowedInTopHits from original suggestion
return Suggestion.bookmark(title: title,
url: url,
isFavorite: isFavorite,
allowedInTopHits: historySuggestion.allowedInTopHits)
#else
return Suggestion.bookmark(title: title,
url: url,
isFavorite: isFavorite,
allowedInTopHits: true)
#endif
} else {
return nil
}
Expand All @@ -178,10 +185,17 @@ final class SuggestionProcessing {
if case .historyEntry = $0, $0.url?.naked == nakedUrl { return true }
return false
}), historySuggestion.allowedInTopHits {
#if os(macOS)
return Suggestion.bookmark(title: title,
url: url,
isFavorite: isFavorite,
allowedInTopHits: historySuggestion.allowedInTopHits)
#else
return Suggestion.bookmark(title: title,
url: url,
isFavorite: isFavorite,
allowedInTopHits: true)
#endif
} else {
return nil
}
Expand Down

0 comments on commit 8c44b25

Please sign in to comment.