if key is not valid delete from history

This commit is contained in:
SrGooglo 2023-05-30 00:57:42 +00:00
parent 01b6fbd71b
commit e6812b6293

View File

@ -7,7 +7,12 @@ export default ({
const [activeKey, setActiveKey] = React.useState(new URLSearchParams(window.location.search).get(queryKey) ?? defaultKey)
const replaceQueryTypeToCurrentTab = (key) => {
app.history.replace(`${window.location.pathname}?${queryKey}=${key}`)
if (!key) {
// delete query
return app.history.replace(window.location.pathname)
}
return app.history.replace(`${window.location.pathname}?${queryKey}=${key}`)
}
const changeActiveKey = (key) => {