Another hotfix for tab switching
This commit is contained in:
parent
36804779e7
commit
f86a199098
1 changed files with 5 additions and 3 deletions
|
|
@ -352,7 +352,8 @@ const Party = (props: Props) => {
|
||||||
function segmentClicked(event: React.ChangeEvent<HTMLInputElement>) {
|
function segmentClicked(event: React.ChangeEvent<HTMLInputElement>) {
|
||||||
const path = [
|
const path = [
|
||||||
// Enable when using Next.js Router
|
// Enable when using Next.js Router
|
||||||
// router.asPath.split('/').filter((el) => el != '')[1],
|
'p',
|
||||||
|
router.asPath.split('/').filter((el) => el != '')[1],
|
||||||
event.target.value,
|
event.target.value,
|
||||||
].join('/')
|
].join('/')
|
||||||
|
|
||||||
|
|
@ -371,9 +372,10 @@ const Party = (props: Props) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ideally, we would use the Next.js Router to replace the URL,
|
// 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
|
// but something about shallow routing isn't working so the page is refreshing.
|
||||||
|
// A consequence is that the browser push stack gets fucked
|
||||||
// router.replace(path, undefined, { shallow: true })
|
// router.replace(path, undefined, { shallow: true })
|
||||||
history.pushState({}, '', path)
|
history.pushState({}, '', '/' + path)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Render: JSX components
|
// Render: JSX components
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue