Hotfix refreshing when switching tabs
This commit is contained in:
parent
3825be8866
commit
652df5f2b9
1 changed files with 6 additions and 2 deletions
|
|
@ -351,7 +351,8 @@ const Party = (props: Props) => {
|
||||||
// Methods: Navigating with segmented control
|
// Methods: Navigating with segmented control
|
||||||
function segmentClicked(event: React.ChangeEvent<HTMLInputElement>) {
|
function segmentClicked(event: React.ChangeEvent<HTMLInputElement>) {
|
||||||
const path = [
|
const path = [
|
||||||
router.asPath.split('/').filter((el) => el != '')[1],
|
// Enable when using Next.js Router
|
||||||
|
// router.asPath.split('/').filter((el) => el != '')[1],
|
||||||
event.target.value,
|
event.target.value,
|
||||||
].join('/')
|
].join('/')
|
||||||
|
|
||||||
|
|
@ -369,7 +370,10 @@ const Party = (props: Props) => {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
router.replace(path, undefined, { shallow: true })
|
// Ideally, we would use the Next.js Router to replace the URL,
|
||||||
|
// but something about shallow routing isn't working so the page is refreshing
|
||||||
|
// router.replace(path, undefined, { shallow: true })
|
||||||
|
history.pushState({}, '', path)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Render: JSX components
|
// Render: JSX components
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue