From b9f009072eec9b39f823c65cb4d59a4ced2316ed Mon Sep 17 00:00:00 2001 From: Shreerang Kale Date: Tue, 29 Jul 2025 11:28:15 +0530 Subject: [PATCH] Reset state variables on switching wallets --- src/app/page.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/page.tsx b/src/app/page.tsx index 046f55b..f5af397 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -71,15 +71,15 @@ export default function Home() { try { // @ts-expect-error: backpack exists on window object const genesisHash = await window.backpack.solana.connection.getGenesisHash(); - + const expectedGenesisHash = selectedPaymentMethod === PaymentMethod.NAT_GOR ? GORBAGANA_GENESIS_HASH : SOLANA_GENESIS_HASH; - + const expectedChainName = selectedPaymentMethod === PaymentMethod.NAT_GOR ? "Gorbagana" : "Solana"; - + if (genesisHash !== expectedGenesisHash) { setIncorrectChainWarning( `Unsupported network selected in wallet. Please switch to network for ${expectedChainName} chain and reconnect the wallet.`