Skip to content

Commit

Permalink
Merge pull request #2311 from zeitgeistpm/web3-fix
Browse files Browse the repository at this point in the history
Web3 Fix
  • Loading branch information
robhyrk authored Feb 23, 2024
2 parents bcfe3fb + e7a2b92 commit 809323a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/hooks/useWeb3Wallet.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { WALLET_ADAPTERS, IProvider } from "@web3auth/base";
import { Keyring } from "@polkadot/keyring";
import { Keyring } from "@polkadot/api";
import { cryptoWaitReady } from "@polkadot/util-crypto";
import { useWallet } from "lib/state/wallet";
import { web3authAtom } from "lib/state/util/web3auth-config";
Expand Down Expand Up @@ -65,7 +65,7 @@ const useWeb3Wallet = () => {
if (web3authProvider) {
await getKeypair(web3authProvider);
}
} catch {
} catch (e) {
notificationStore.pushNotification(
`Error connecting: please try again later.`,
{
Expand Down
4 changes: 3 additions & 1 deletion lib/state/util/web3auth-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { atom } from "jotai";
import { OpenloginAdapter } from "@web3auth/openlogin-adapter";
import { CommonPrivateKeyProvider } from "@web3auth/base-provider";
import { TypeOfLogin } from "@web3auth/openlogin-adapter";
import { environment } from "lib/constants/index";

interface LoginConfig {
[key: string]: {
Expand Down Expand Up @@ -61,7 +62,8 @@ export const web3authNoModal =
? new Web3AuthNoModal({
clientId,
chainConfig,
web3AuthNetwork: "sapphire_devnet",
web3AuthNetwork:
environment === "production" ? "sapphire_mainnet" : "sapphire_devnet",
})
: null;

Expand Down

0 comments on commit 809323a

Please sign in to comment.