Skip to content

Commit

Permalink
Fix URLs breaking on date picker navigation
Browse files Browse the repository at this point in the history
This prevents the date picker from updating the URL
with data domain on each subsequent use. Only the query
string should be updated.
  • Loading branch information
aerosol committed Jul 9, 2024
1 parent 22b18db commit 6944507
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions assets/js/dashboard/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export function navigateToQuery(history, queryFrom, newData) {
// if we update any data that we store in localstorage, make sure going back in history will
// revert them
if (newData.period && newData.period !== queryFrom.period) {
history.replace({ search: updatedQuery({ period: queryFrom.period}) })
history.replace({ search: updatedQuery({ period: queryFrom.period }) })
}

// then push the new query to the history
Expand Down Expand Up @@ -135,7 +135,7 @@ export function filtersBackwardsCompatibilityRedirect() {
}

function QueryLink(props) {
const {query, history, to, className, children} = props
const { query, history, to, className, children } = props

function onClick(e) {
e.preventDefault()
Expand Down Expand Up @@ -167,7 +167,7 @@ function QueryButton({ history, query, to, disabled, className, children, onClic
event.preventDefault()
navigateToQuery(history, query, to)
if (onClick) onClick(event)
history.push({ pathname: window.location.pathname, search: updatedQuery(to) })
history.push({ search: updatedQuery(to) })
}}
type="button"
disabled={disabled}
Expand Down

0 comments on commit 6944507

Please sign in to comment.