mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2024-12-13 16:06:21 +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
|
||||
.filter((v, i, a) => {
|
||||
// Filter out invalid values
|
||||
if (!v) return false
|
||||
|
||||
const match = v.match(/^(sort|orderby):(\w+)(:.*)?$/i)
|
||||
// Uniquify sort/orderby filters by their keys
|
||||
if (match && match[2]) {
|
||||
@ -1259,7 +1262,7 @@ page.uniquifyUploadsFilters = string => {
|
||||
return lastIndex === i
|
||||
}
|
||||
// Uniquify other filters by exact string matches
|
||||
return i !== a.lastIndexOf(v)
|
||||
return i === a.lastIndexOf(v)
|
||||
})
|
||||
|
||||
return uniquified
|
||||
|
Loading…
Reference in New Issue
Block a user