Reset state variables on switching wallets
This commit is contained in:
parent
438acd5e29
commit
b9f009072e
@ -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.`
|
||||
|
Loading…
Reference in New Issue
Block a user