Skip to content

Commit

Permalink
fix: app crashed when trying to connect while ArgentX wasn't installed
Browse files Browse the repository at this point in the history
  • Loading branch information
CarmitKl authored and dan-ziv committed Apr 14, 2022
1 parent 834c149 commit fac0208
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/config/envs.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import utils from '../utils';
const envs = {
env: process.env.NODE_ENV,
appUrl: process.env.REACT_APP_URL,
autoConnect: Boolean(process.env.REACT_APP_AUTO_CONNECT),
autoConnect: process.env.REACT_APP_AUTO_CONNECT === 'true',
pollBlockNumberInterval: Number(process.env.REACT_APP_POLL_BLOCK_NUMBER_INTERVAL),
supportedTokens: process.env.REACT_APP_SUPPORTED_TOKENS.split(','),
supportedChainId: Number(process.env.REACT_APP_SUPPORTED_CHAIN_ID),
Expand Down
7 changes: 5 additions & 2 deletions src/providers/WalletsProvider/WalletsProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,11 @@ export const WalletsProvider = ({children}) => {
};

const connectL2Wallet = async walletConfig => {
await getStarknet().enable(!autoConnect && {showModal: true});
setL2WalletConfig(walletConfig);
try {
await getStarknet().enable(!autoConnect && {showModal: true});
setL2WalletConfig(walletConfig);
// eslint-disable-next-line no-empty
} catch {}
};

const resetWallet = () => {
Expand Down

0 comments on commit fac0208

Please sign in to comment.