|
|
@ -2,8 +2,15 @@ import Home from './home.component' |
|
|
|
import { compose } from 'redux' |
|
|
|
import { compose } from 'redux' |
|
|
|
import { connect } from 'react-redux' |
|
|
|
import { connect } from 'react-redux' |
|
|
|
import { withRouter } from 'react-router-dom' |
|
|
|
import { withRouter } from 'react-router-dom' |
|
|
|
import { unconfirmedTransactionsCountSelector } from '../../selectors/confirm-transaction' |
|
|
|
import { |
|
|
|
import { getCurrentEthBalance, getDaiV1Token, getFirstPermissionRequest } from '../../selectors/selectors' |
|
|
|
unconfirmedTransactionsCountSelector, |
|
|
|
|
|
|
|
} from '../../selectors/confirm-transaction' |
|
|
|
|
|
|
|
import { |
|
|
|
|
|
|
|
getCurrentEthBalance, |
|
|
|
|
|
|
|
getDaiV1Token, |
|
|
|
|
|
|
|
getFirstPermissionRequest, |
|
|
|
|
|
|
|
getTotalUnapprovedCount, |
|
|
|
|
|
|
|
} from '../../selectors/selectors' |
|
|
|
import { |
|
|
|
import { |
|
|
|
restoreFromThreeBox, |
|
|
|
restoreFromThreeBox, |
|
|
|
turnThreeBoxSyncingOn, |
|
|
|
turnThreeBoxSyncingOn, |
|
|
@ -12,7 +19,10 @@ import { |
|
|
|
} from '../../store/actions' |
|
|
|
} from '../../store/actions' |
|
|
|
import { setThreeBoxLastUpdated } from '../../ducks/app/app' |
|
|
|
import { setThreeBoxLastUpdated } from '../../ducks/app/app' |
|
|
|
import { getEnvironmentType } from '../../../../app/scripts/lib/util' |
|
|
|
import { getEnvironmentType } from '../../../../app/scripts/lib/util' |
|
|
|
import { ENVIRONMENT_TYPE_POPUP } from '../../../../app/scripts/lib/enums' |
|
|
|
import { |
|
|
|
|
|
|
|
ENVIRONMENT_TYPE_NOTIFICATION, |
|
|
|
|
|
|
|
ENVIRONMENT_TYPE_POPUP, |
|
|
|
|
|
|
|
} from '../../../../app/scripts/lib/enums' |
|
|
|
|
|
|
|
|
|
|
|
const mapStateToProps = (state) => { |
|
|
|
const mapStateToProps = (state) => { |
|
|
|
const { metamask, appState } = state |
|
|
|
const { metamask, appState } = state |
|
|
@ -26,8 +36,12 @@ const mapStateToProps = (state) => { |
|
|
|
} = metamask |
|
|
|
} = metamask |
|
|
|
const accountBalance = getCurrentEthBalance(state) |
|
|
|
const accountBalance = getCurrentEthBalance(state) |
|
|
|
const { forgottenPassword, threeBoxLastUpdated } = appState |
|
|
|
const { forgottenPassword, threeBoxLastUpdated } = appState |
|
|
|
|
|
|
|
const totalUnapprovedCount = getTotalUnapprovedCount(state) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const envType = getEnvironmentType() |
|
|
|
|
|
|
|
const isPopup = envType === ENVIRONMENT_TYPE_POPUP |
|
|
|
|
|
|
|
const isNotification = envType === ENVIRONMENT_TYPE_NOTIFICATION |
|
|
|
|
|
|
|
|
|
|
|
const isPopup = getEnvironmentType() === ENVIRONMENT_TYPE_POPUP |
|
|
|
|
|
|
|
const firstPermissionsRequest = getFirstPermissionRequest(state) |
|
|
|
const firstPermissionsRequest = getFirstPermissionRequest(state) |
|
|
|
const firstPermissionsRequestId = (firstPermissionsRequest && firstPermissionsRequest.metadata) |
|
|
|
const firstPermissionsRequestId = (firstPermissionsRequest && firstPermissionsRequest.metadata) |
|
|
|
? firstPermissionsRequest.metadata.id |
|
|
|
? firstPermissionsRequest.metadata.id |
|
|
@ -39,12 +53,14 @@ const mapStateToProps = (state) => { |
|
|
|
unconfirmedTransactionsCount: unconfirmedTransactionsCountSelector(state), |
|
|
|
unconfirmedTransactionsCount: unconfirmedTransactionsCountSelector(state), |
|
|
|
shouldShowSeedPhraseReminder: !seedPhraseBackedUp && (parseInt(accountBalance, 16) > 0 || tokens.length > 0), |
|
|
|
shouldShowSeedPhraseReminder: !seedPhraseBackedUp && (parseInt(accountBalance, 16) > 0 || tokens.length > 0), |
|
|
|
isPopup, |
|
|
|
isPopup, |
|
|
|
|
|
|
|
isNotification, |
|
|
|
threeBoxSynced, |
|
|
|
threeBoxSynced, |
|
|
|
showRestorePrompt, |
|
|
|
showRestorePrompt, |
|
|
|
selectedAddress, |
|
|
|
selectedAddress, |
|
|
|
threeBoxLastUpdated, |
|
|
|
threeBoxLastUpdated, |
|
|
|
hasDaiV1Token: Boolean(getDaiV1Token(state)), |
|
|
|
hasDaiV1Token: Boolean(getDaiV1Token(state)), |
|
|
|
firstPermissionsRequestId, |
|
|
|
firstPermissionsRequestId, |
|
|
|
|
|
|
|
totalUnapprovedCount, |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|