mirror of
https://github.com/plausible/analytics.git
synced 2024-11-26 23:27:54 +03:00
Update Filters to use new navigation function
This commit is contained in:
parent
3524a89fb3
commit
53ac7d3bc7
@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import { withRouter } from 'react-router-dom'
|
||||
import {removeQueryParam} from './query'
|
||||
import {navigateToQuery, removeQueryParam} from './query'
|
||||
import Datamap from 'datamaps'
|
||||
|
||||
function filterText(key, value, query) {
|
||||
@ -56,9 +56,15 @@ function filterText(key, value, query) {
|
||||
|
||||
function renderFilter(history, [key, value], query) {
|
||||
function removeFilter() {
|
||||
let newQuery = removeQueryParam(location.search, key)
|
||||
if (key === 'goal') { newQuery = removeQueryParam(newQuery, 'props') }
|
||||
history.push({search: newQuery})
|
||||
const newOpts = {
|
||||
[key]: false
|
||||
}
|
||||
if (key === 'goal') { newOpts.props = false }
|
||||
navigateToQuery(
|
||||
history,
|
||||
query,
|
||||
newOpts
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
|
Loading…
Reference in New Issue
Block a user