mirror of
https://github.com/kremalicious/umami.git
synced 2024-12-24 02:06:19 +01:00
Fix filter clear all button.
This commit is contained in:
parent
2411aeae8d
commit
8da72a693d
@ -4,7 +4,7 @@ import usePageQuery from 'hooks/usePageQuery';
|
||||
import styles from './FilterTags.module.css';
|
||||
import useMessages from 'hooks/useMessages';
|
||||
|
||||
export default function FilterTags({ websiteId, params }) {
|
||||
export default function FilterTags({ params }) {
|
||||
const { formatMessage, labels } = useMessages();
|
||||
const {
|
||||
router,
|
||||
@ -18,7 +18,7 @@ export default function FilterTags({ websiteId, params }) {
|
||||
|
||||
function handleCloseFilter(param) {
|
||||
if (!param) {
|
||||
router.push(`/websites/${websiteId}${view ? `?view=${view}` : ''}`);
|
||||
router.push(resolveUrl({ view }, true));
|
||||
} else {
|
||||
router.push(resolveUrl({ [param]: undefined }));
|
||||
}
|
||||
|
@ -23,8 +23,8 @@ export default function usePageQuery() {
|
||||
}, {});
|
||||
}, [search]);
|
||||
|
||||
function resolveUrl(params) {
|
||||
return buildUrl(asPath.split('?')[0], { ...query, ...params });
|
||||
function resolveUrl(params, reset) {
|
||||
return buildUrl(asPath.split('?')[0], { ...(reset ? {} : query), ...params });
|
||||
}
|
||||
|
||||
return { pathname, query, resolveUrl, router };
|
||||
|
Loading…
Reference in New Issue
Block a user