From 514ed28cfcf7de871dcb8e3a9c37ecec7c790bf5 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Wed, 23 Feb 2022 14:52:44 -0800 Subject: [PATCH] Clean state when New button is pressed --- components/TopHeader/index.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/components/TopHeader/index.tsx b/components/TopHeader/index.tsx index 596d511c..53cce7c1 100644 --- a/components/TopHeader/index.tsx +++ b/components/TopHeader/index.tsx @@ -42,7 +42,14 @@ const TopHeader = () => { } function newParty() { + // Push the root URL router.push('/') + + // Clean state + const resetState = clonedeep(initialAppState) + Object.keys(resetState).forEach((key) => { + appState[key] = resetState[key] + }) } function logout() {