fix: empty query string with trailing ?

Fixes #1376
This commit is contained in:
Hussain Nagaria
2025-03-12 14:37:50 +05:30
parent a24afad641
commit be9525dbf2
2 changed files with 13 additions and 2 deletions

View File

@@ -251,7 +251,12 @@ const setQueryParams = () => {
}
})
history.replaceState({}, '', `${location.pathname}?${queries.toString()}`)
let queryString = '';
if (queries.toString()) {
queryString = `?${queries.toString()}`
}
history.replaceState({}, '', `${location.pathname}${queryString}`)
}
const updateCategories = (data) => {

View File

@@ -256,7 +256,13 @@ const setQueryParams = () => {
}
})
history.replaceState({}, '', `${location.pathname}?${queries.toString()}`)
let queryString = '';
if (queries.toString()) {
queryString = `?${queries.toString()}`
}
history.replaceState({}, '', `${location.pathname}${queryString}`)
}
const updateCategories = (data) => {