Skip to content

Commit

Permalink
chore: remove trailing ? in url (#226)
Browse files Browse the repository at this point in the history
  • Loading branch information
hughcrt authored Apr 15, 2024
1 parent 6d2bcb4 commit 2663d1d
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions packages/frontend/pages/logs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,12 @@ export default function Logs() {
const search = urlParams.get("search")
setQuery(search)

const filtersData = deserializeLogic(urlParams.toString())
if (filtersData) {
setChecks(filtersData)
const paramString = urlParams.toString()
if (paramString) {
const filtersData = deserializeLogic(paramString)
if (filtersData) {
setChecks(filtersData)
}
}
} catch (e) {
console.error(e)
Expand All @@ -203,6 +206,13 @@ export default function Logs() {
pathname: router.pathname,
query: { ...router.query, selected: selectedId },
})
} else {
const { selected, ...query } = router.query

router.push({
pathname: router.pathname,
query,
})
}
}, [selectedId])

Expand Down

0 comments on commit 2663d1d

Please sign in to comment.