mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2025-01-07 12:21:33 +00:00
fix: non-sort filter keys getting removed
This commit is contained in:
parent
a44af208aa
commit
9af34a08f8
@ -1250,6 +1250,9 @@ page.uniquifyUploadsFilters = string => {
|
|||||||
|
|
||||||
const uniquified = filtersArray
|
const uniquified = filtersArray
|
||||||
.filter((v, i, a) => {
|
.filter((v, i, a) => {
|
||||||
|
// Filter out invalid values
|
||||||
|
if (!v) return false
|
||||||
|
|
||||||
const match = v.match(/^(sort|orderby):(\w+)(:.*)?$/i)
|
const match = v.match(/^(sort|orderby):(\w+)(:.*)?$/i)
|
||||||
// Uniquify sort/orderby filters by their keys
|
// Uniquify sort/orderby filters by their keys
|
||||||
if (match && match[2]) {
|
if (match && match[2]) {
|
||||||
@ -1259,7 +1262,7 @@ page.uniquifyUploadsFilters = string => {
|
|||||||
return lastIndex === i
|
return lastIndex === i
|
||||||
}
|
}
|
||||||
// Uniquify other filters by exact string matches
|
// Uniquify other filters by exact string matches
|
||||||
return i !== a.lastIndexOf(v)
|
return i === a.lastIndexOf(v)
|
||||||
})
|
})
|
||||||
|
|
||||||
return uniquified
|
return uniquified
|
||||||
|
Loading…
Reference in New Issue
Block a user