diff --git a/packages/web/src/common/clients/wallet-client/social/config.ts b/packages/web/src/common/clients/wallet-client/social/config.ts index 13f49931e..8ccaee14c 100644 --- a/packages/web/src/common/clients/wallet-client/social/config.ts +++ b/packages/web/src/common/clients/wallet-client/social/config.ts @@ -1,4 +1,5 @@ import { + DEFAULT_CHAIN_RPC_URL, SOCIAL_WALLET_AUTH_CLIENT_ID, SOCIAL_WALLET_AUTH_DOMAIN, SOCIAL_WALLET_EMAIL_VERIFIER, @@ -25,7 +26,7 @@ export const getSocialWalletConfig = (type: SocialLoginType): SocialWalletConfig clientId: SOCIAL_WALLET_WEB3AUTH_CLIENT_ID, authClientId: SOCIAL_WALLET_AUTH_CLIENT_ID, network: "testnet", - rpcTarget: "https://rpc.test4.gno.land", + rpcTarget: DEFAULT_CHAIN_RPC_URL, domain: SOCIAL_WALLET_AUTH_DOMAIN, name: "Adena Wallet", verifier: "", diff --git a/packages/web/src/hooks/wallet/data/use-wallet.ts b/packages/web/src/hooks/wallet/data/use-wallet.ts index e132f02f0..213d52f47 100644 --- a/packages/web/src/hooks/wallet/data/use-wallet.ts +++ b/packages/web/src/hooks/wallet/data/use-wallet.ts @@ -154,8 +154,15 @@ export const useWallet = () => { } setLoadingConnect("done"); } catch { - // initialize adena client - connectAdenaClient(); + const currentWalletType = sessionStorage.getItem(GNOSWAP_WALLET_TYPE_KEY); + const savedSocialLoginType = sessionStorage.getItem(GNOSWAP_SOCIAL_LOGIN_TYPE_KEY); + + // initialize Adena-client or Social-wallet-client + if (currentWalletType === "SOCIAL_WALLET" && savedSocialLoginType) { + await connectSocialWalletClient(savedSocialLoginType as SocialLoginType); + } else if (walletType.type === "ADENA") { + connectAdenaClient(); + } } };