From ab74be63067cd1d2c1f28e698ebae706a85e0183 Mon Sep 17 00:00:00 2001 From: ALEKH SRIVASTAVA <94829051+NAKLI-CODER@users.noreply.github.com> Date: Wed, 20 Dec 2023 02:32:11 +0530 Subject: [PATCH] devnet switch fix --- packages/site/src/pages/index.tsx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/site/src/pages/index.tsx b/packages/site/src/pages/index.tsx index a4012cd..14f85d8 100644 --- a/packages/site/src/pages/index.tsx +++ b/packages/site/src/pages/index.tsx @@ -529,8 +529,18 @@ if(forecastCronJobActive) { setIsMainnet(true); } else { setIsMainnet(false); - const updatedBalance = await sendGetBalance(network); - setBalance(updatedBalance); + try{ + const updatedBalance = await sendGetBalance(network); + setBalance(updatedBalance); + } + catch (error){ + const accountinfo: any = await sendGetAccount(password, network); + const { accountInfo } = accountinfo; + const { address, bal } = accountInfo; + setAddress(address); + setBalance(bal); + } + } }; return (