File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
packages/shared/src/UI/components/Privy Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 11import { CrossIsolationMessages , EMPTY_LIST , PersistentStorages } from '@masknet/shared-base'
22import { usePersistSubscription } from '@masknet/shared-base-ui'
3- import { useAccount } from '@masknet/web3-hooks-base'
3+ import { useAccount , useChainContext } from '@masknet/web3-hooks-base'
44import { EVMWeb3 , MaskWalletProvider } from '@masknet/web3-providers'
55import { isSameAddress } from '@masknet/web3-shared-base'
66import { ProviderType } from '@masknet/web3-shared-evm'
@@ -30,14 +30,17 @@ export const PrivySetup = memo(function PrivySetup() {
3030 '@@mask-wallets' ,
3131 MaskWalletProvider . subscription . wallets ?? EMPTY_LIST ,
3232 )
33+ const { providerType } = useChainContext ( )
3334 useAsync ( async ( ) => {
3435 const newWallets = wallets . filter ( ( x ) => ! existedWallets . find ( ( y ) => isSameAddress ( y . address , x . address ) ) )
3536 if ( ! newWallets . length ) return
3637 CrossIsolationMessages . events . walletsUpdated . sendToAll ( )
38+ if ( providerType !== ProviderType . MaskWallet ) return
3739 if ( ! existedWallets || ! account ) {
3840 await EVMWeb3 . connect ( {
3941 account : newWallets [ 0 ] . address ,
4042 providerType : ProviderType . MaskWallet ,
43+ silent : true ,
4144 } )
4245 }
4346 } , [ ready , wallets ] )
You can’t perform that action at this time.
0 commit comments