@@ -15,31 +15,24 @@ const dappMetadata = {
1515 url : 'https://metamask.github.io/test-dapp/' ,
1616} ;
1717
18- // eslint-disable-next-line require-unicode-regexp
19- const isAndroid = / A n d r o i d / i. test ( navigator . userAgent ) ;
20-
2118const sdk = new MetaMaskSDK ( { dappMetadata } ) ;
2219
2320export const initializeWeb3Modal = ( ) => {
24- if ( ! isAndroid ) {
25- try {
26- // eslint-disable-next-line node/global-require
27- const { createWeb3Modal, defaultConfig } = require ( '@web3modal/ethers5' ) ;
21+ try {
22+ // eslint-disable-next-line node/global-require
23+ const { createWeb3Modal, defaultConfig } = require ( '@web3modal/ethers5' ) ;
2824
29- const web3Modal = createWeb3Modal ( {
30- ethersConfig : defaultConfig ( { metadata : dappMetadata } ) ,
31- projectId : 'e6360eaee594162688065f1c70c863b7' ,
32- } ) ;
25+ const web3Modal = createWeb3Modal ( {
26+ ethersConfig : defaultConfig ( { metadata : dappMetadata } ) ,
27+ projectId : 'e6360eaee594162688065f1c70c863b7' ,
28+ } ) ;
3329
34- console . log ( 'Web3Modal initialized successfully' ) ;
35- return web3Modal ;
36- } catch ( error ) {
37- console . error ( 'Error initializing Web3Modal' , error ) ;
38- }
30+ console . log ( 'Web3Modal initialized successfully' ) ;
31+ return web3Modal ;
32+ } catch ( error ) {
33+ console . error ( 'Error initializing Web3Modal' , error ) ;
34+ return null ;
3935 }
40-
41- console . log ( 'Web3Modal is not initialized' ) ;
42- return null ;
4336} ;
4437
4538export const walletConnect = initializeWeb3Modal ( ) ;
0 commit comments