Skip to content

Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.

Update Countries to use new navigation function

birjolaxew21b88b996d3a
diff --git a/assets/js/dashboard/stats/countries.js b/assets/js/dashboard/stats/countries.js
index 1df83082ba..bea80e9006 100644
--- a/assets/js/dashboard/stats/countries.js
+++ b/assets/js/dashboard/stats/countries.js
@@ -7,6 +7,7 @@ import FadeIn from '../fade-in'
import Bar from './bar'
import MoreLink from './more-link'
import * as api from '../api'
+import { navigateToQuery } from '../query';
class Countries extends React.Component {
constructor(props) {
@@ -92,9 +93,13 @@ class Countries extends React.Component {
},
done: (datamap) => {
datamap.svg.selectAll('.datamaps-subunit').on('click', (geography) => {
- const query = new URLSearchParams(window.location.search)
- query.set('country', geography.id)
- this.props.history.push({search: query.toString()})
+ navigateToQuery(
+ this.props.history,
+ this.props.query,
+ {
+ country: geography.id
+ }
+ )
})
}
});