Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ensure bookmarks can be shown in top hits #818

Merged
merged 9 commits into from
May 23, 2024
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
Loading