Skip to content

Commit

Permalink
fix: [GSW-2040] SocialWallet Default Chain RPC URL, WalletClient hand…
Browse files Browse the repository at this point in the history
…ling in switched networks
  • Loading branch information
tfrg committed Jan 10, 2025
1 parent 40f4484 commit dac93a3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {
DEFAULT_CHAIN_RPC_URL,
SOCIAL_WALLET_AUTH_CLIENT_ID,
SOCIAL_WALLET_AUTH_DOMAIN,
SOCIAL_WALLET_EMAIL_VERIFIER,
Expand All @@ -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: "",
Expand Down
11 changes: 9 additions & 2 deletions packages/web/src/hooks/wallet/data/use-wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
};

Expand Down

0 comments on commit dac93a3

Please sign in to comment.