diff --git a/src/routes/safe/component/Transactions/Transaction/index.jsx b/src/routes/safe/component/Transactions/Transaction/index.jsx index 5d5650f4..7ee48833 100644 --- a/src/routes/safe/component/Transactions/Transaction/index.jsx +++ b/src/routes/safe/component/Transactions/Transaction/index.jsx @@ -1,5 +1,6 @@ // @flow import * as React from 'react' +import { List } from 'immutable' import { connect } from 'react-redux' import openHoc, { type Open } from '~/components/hoc/OpenHoc' import ExpandLess from 'material-ui-icons/ExpandLess' @@ -16,6 +17,8 @@ import Collapsed from '~/routes/safe/component/Transactions/Collapsed' import { type Transaction } from '~/routes/safe/store/model/transaction' import Hairline from '~/components/layout/Hairline/index' import Button from '~/components/layout/Button' +import { sameAddress } from '~/wallets/ethAddresses' +import { type Confirmation } from '~/routes/safe/store/model/confirmation' import selector, { type SelectorProps } from './selector' type Props = Open & SelectorProps & { @@ -29,13 +32,17 @@ export const PROCESS_TXS = 'PROCESS TRANSACTION' class GnoTransaction extends React.PureComponent { onProccesClick = () => this.props.onProcessTx(this.props.transaction, this.props.confirmed) + hasConfirmed = (userAddress: string, confirmations: List): boolean => + confirmations.filter((conf: Confirmation) => sameAddress(userAddress, conf.get('owner').get('address')) && conf.get('status')).count() > 0 + render() { const { - open, toggle, transaction, confirmed, safeName, + open, toggle, transaction, confirmed, safeName, userAddress, } = this.props const txHash = transaction.get('tx') const confirmationText = txHash ? 'Already executed' : `${confirmed} of the ${transaction.get('threshold')} confirmations needed` + const userConfirmed = this.hasConfirmed(userAddress, transaction.get('confirmations')) return ( @@ -66,7 +73,13 @@ class GnoTransaction extends React.PureComponent { } - { !txHash && + { !txHash && userConfirmed && + + + + + } + { !txHash && !userConfirmed &&