mirror of https://github.com/FreeTubeApp/FreeTube
Fix bookmark searching logic
This commit is contained in:
parent
e60cd786e9
commit
c254875e2e
|
@ -102,7 +102,7 @@ export default defineComponent({
|
|||
},
|
||||
|
||||
matchingBookmarksDataList: function () {
|
||||
return this.$store.getters.getPageBookmarksWithRouteSubstring(this.lastSuggestionQuery, this.currentRouteFullPath)
|
||||
return this.$store.getters.getPageBookmarksMatchingQuery(this.lastSuggestionQuery, this.currentRouteFullPath)
|
||||
},
|
||||
|
||||
pageBookmarkIconTitle: function () {
|
||||
|
|
|
@ -14,13 +14,13 @@ const getters = {
|
|||
return pageBookmark
|
||||
},
|
||||
|
||||
getPageBookmarksWithRouteSubstring: (state) => (routeSubstring, routeToExclude) => {
|
||||
if (routeSubstring === '') {
|
||||
getPageBookmarksMatchingQuery: (state) => (query, routeToExclude) => {
|
||||
if (query === '') {
|
||||
return []
|
||||
}
|
||||
const routeSubstringToLower = routeSubstring.toLowerCase()
|
||||
const queryToLower = query.toLowerCase()
|
||||
const pageBookmarks = state.pageBookmarks.filter((pageBookmark) =>
|
||||
pageBookmark && pageBookmark.route.toLowerCase().includes(routeSubstringToLower) && pageBookmark.route !== routeToExclude
|
||||
pageBookmark && pageBookmark.bookmarkName.toLowerCase().includes(queryToLower) && pageBookmark.route !== routeToExclude
|
||||
)
|
||||
return pageBookmarks
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue