@@ -7,25 +7,31 @@ import {
7
7
} from 'decentraland-dapps/dist/modules/authorization/actions'
8
8
import { getError , getLoading as getAuthorizationLoading } from 'decentraland-dapps/dist/modules/authorization/selectors'
9
9
import { isLoadingType } from 'decentraland-dapps/dist/modules/loading/selectors'
10
+ import { isWeb2Wallet } from 'decentraland-dapps/dist/modules/wallet/utils'
10
11
import { ContractName , getContract } from 'decentraland-transactions'
12
+ import { getIsMagicAutoSignEnabled } from '../../../../modules/features/selectors'
11
13
import { RootState } from '../../../../modules/reducer'
12
14
import { getPendingAuthorizationTransactions } from '../../../../modules/transaction/selectors'
13
15
import { hasTransactionPending } from '../../../../modules/transaction/utils'
14
- import { getAddress } from '../../../../modules/wallet/selectors'
16
+ import { getAddress , getWallet } from '../../../../modules/wallet/selectors'
15
17
import AuthorizationStep from './AuthorizationStep'
16
18
import { MapStateProps , MapDispatchProps , MapDispatch , OwnProps } from './AuthorizationStep.types'
17
19
18
- const mapState = ( state : RootState , { nft } : OwnProps ) : MapStateProps => ( {
19
- address : getAddress ( state ) ! ,
20
- isAuthorizing : hasTransactionPending (
21
- getPendingAuthorizationTransactions ( state ) ,
22
- getContract ( ContractName . Rentals , nft . chainId ) . address ,
23
- nft . contractAddress
24
- ) ,
25
- isConfirmingAuthorization : isLoadingType ( getAuthorizationLoading ( state ) , GRANT_TOKEN_REQUEST ) ,
26
- error : getError ( state ) ,
27
- isFetchingAuthorizations : isLoadingType ( getAuthorizationLoading ( state ) , FETCH_AUTHORIZATIONS_REQUEST )
28
- } )
20
+ const mapState = ( state : RootState , { nft } : OwnProps ) : MapStateProps => {
21
+ const wallet = getWallet ( state )
22
+ return {
23
+ address : getAddress ( state ) ! ,
24
+ isWeb2AutoSigning : getIsMagicAutoSignEnabled ( state ) && wallet !== null && isWeb2Wallet ( wallet ) ,
25
+ isAuthorizing : hasTransactionPending (
26
+ getPendingAuthorizationTransactions ( state ) ,
27
+ getContract ( ContractName . Rentals , nft . chainId ) . address ,
28
+ nft . contractAddress
29
+ ) ,
30
+ isConfirmingAuthorization : isLoadingType ( getAuthorizationLoading ( state ) , GRANT_TOKEN_REQUEST ) ,
31
+ error : getError ( state ) ,
32
+ isFetchingAuthorizations : isLoadingType ( getAuthorizationLoading ( state ) , FETCH_AUTHORIZATIONS_REQUEST )
33
+ }
34
+ }
29
35
30
36
const mapDispatch = ( dispatch : MapDispatch ) : MapDispatchProps => ( {
31
37
onAuthorize : authorization => dispatch ( grantTokenRequest ( authorization ) ) ,
0 commit comments