mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-10 02:54:15 +00:00
if key is not valid delete from history
This commit is contained in:
parent
01b6fbd71b
commit
e6812b6293
@ -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) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user