Browse Source

Adjust OperationDetail with updated Operation type

master
meriadec 7 years ago
parent
commit
82655baf43
No known key found for this signature in database GPG Key ID: 1D2FC2305E2CB399
  1. 2
      src/components/OperationsList/index.js
  2. 27
      src/components/modals/OperationDetails.js
  3. 3
      src/internals/accounts/scanAccountsOnDevice.js

2
src/components/OperationsList/index.js

@ -126,7 +126,7 @@ export class OperationsList extends PureComponent<Props> {
return (
<Operation
account={account}
key={`${account.id}-${op.hash}`}
key={op.id}
onAccountClick={onAccountClick}
onOperationClick={this.handleClickOperation}
op={op}

27
src/components/modals/OperationDetails.js

@ -69,10 +69,7 @@ type Props = {
const OperationDetails = connect(mapStateToProps)((props: Props) => {
const { t, type, onClose, operation, account, marketColor, currencySettings } = props
const { id, amount, date } = operation
// $FlowFixMe YEAH, I know those fields should not be present in operation
const { from, to } = operation
const { id, hash, amount, date, senders, recipients } = operation
const { name, unit, currency } = account
const confirmations = account.blockHeight - operation.blockHeight
@ -131,34 +128,18 @@ const OperationDetails = connect(mapStateToProps)((props: Props) => {
<B />
<Line>
<ColLeft>From</ColLeft>
<ColRight>
{from.map((v, i) => (
<CanSelect
key={i} // eslint-disable-line react/no-array-index-key
>
{v}
</CanSelect>
))}
</ColRight>
<ColRight>{senders.map(v => <CanSelect key={v}> {v} </CanSelect>)}</ColRight>
</Line>
<B />
<Line>
<ColLeft>To</ColLeft>
<ColRight>
{to.map((v, i) => (
<CanSelect
key={i} // eslint-disable-line react/no-array-index-key
>
{v}
</CanSelect>
))}
</ColRight>
<ColRight>{recipients.map(v => <CanSelect key={v}> {v} </CanSelect>)}</ColRight>
</Line>
<B />
<Line>
<ColLeft>Identifier</ColLeft>
<ColRight>
<CanSelect>{id}</CanSelect>
<CanSelect>{hash}</CanSelect>
</ColRight>
</Line>
</ModalContent>

3
src/internals/accounts/scanAccountsOnDevice.js

@ -236,6 +236,7 @@ async function buildAccountRaw({
}
function buildOperationRaw({ core, op, xpub }: { core: Object, op: NJSOperation, xpub: string }) {
const id = op.getUid()
const bitcoinLikeOperation = op.asBitcoinLikeOperation()
const bitcoinLikeTransaction = bitcoinLikeOperation.getTransaction()
const hash = bitcoinLikeTransaction.getHash()
@ -246,7 +247,7 @@ function buildOperationRaw({ core, op, xpub }: { core: Object, op: NJSOperation,
const amount = operationType === core.OPERATION_TYPES.SEND ? -absoluteAmount : absoluteAmount
return {
id: hash,
id,
hash,
address: '',
senders: op.getSenders(),

Loading…
Cancel
Save