Home page hack: discard NextJS router state
This commit is contained in:
parent
972f215f0c
commit
c80f82a3f7
|
@ -101,13 +101,19 @@ const useContractPage = () => {
|
|||
|
||||
window.history.pushState = function () {
|
||||
// eslint-disable-next-line prefer-rest-params
|
||||
pushState.apply(history, arguments as any)
|
||||
const args = [...(arguments as any)] as any
|
||||
// Discard NextJS router state.
|
||||
args[0] = null
|
||||
pushState.apply(history, args)
|
||||
updateContract()
|
||||
}
|
||||
|
||||
window.history.replaceState = function () {
|
||||
// eslint-disable-next-line prefer-rest-params
|
||||
replaceState.apply(history, arguments as any)
|
||||
const args = [...(arguments as any)] as any
|
||||
// Discard NextJS router state.
|
||||
args[0] = null
|
||||
replaceState.apply(history, args)
|
||||
updateContract()
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user