From c80f82a3f7f4c543131095e6bfaa45a4c23c30a2 Mon Sep 17 00:00:00 2001 From: James Grugett Date: Mon, 15 Aug 2022 11:06:42 -0500 Subject: [PATCH] Home page hack: discard NextJS router state --- web/pages/home.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/web/pages/home.tsx b/web/pages/home.tsx index b11c0cf9..1fd163ea 100644 --- a/web/pages/home.tsx +++ b/web/pages/home.tsx @@ -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() }