From 8f6f72ec9640b2a3f6fe6bc55cf2030ee2f93b10 Mon Sep 17 00:00:00 2001 From: Juan Cortes Ross Date: Tue, 11 Dec 2018 12:23:13 +0100 Subject: [PATCH 1/2] Adds tag to transaction details --- src/bridge/RippleJSBridge.js | 5 +++-- src/components/modals/OperationDetails.js | 12 ++++++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/bridge/RippleJSBridge.js b/src/bridge/RippleJSBridge.js index 27fe883f..9dfd34c5 100644 --- a/src/bridge/RippleJSBridge.js +++ b/src/bridge/RippleJSBridge.js @@ -121,7 +121,7 @@ async function signAndBroadcast({ a, t, deviceId, isCancelled, onSigned, onOpera transactionSequenceNumber: (a.operations.length > 0 ? a.operations[0].transactionSequenceNumber : 0) + a.pendingOperations.length, - extra: {}, + extra: { tag: t.tag }, } onOperationBroadcasted(op) } @@ -164,6 +164,7 @@ type Tx = { currency: string, value: string, }, + tag?: string, }, paths: string, }, @@ -233,7 +234,7 @@ const txToOperation = (account: Account) => ({ recipients: [destination.address], date: new Date(timestamp), transactionSequenceNumber: sequence, - extra: {}, + extra: { tag: destination.tag }, } return op } diff --git a/src/components/modals/OperationDetails.js b/src/components/modals/OperationDetails.js index cd314022..bb77163f 100644 --- a/src/components/modals/OperationDetails.js +++ b/src/components/modals/OperationDetails.js @@ -3,7 +3,7 @@ import React, { Fragment, Component } from 'react' import { connect } from 'react-redux' import { openURL } from 'helpers/linking' -import { translate } from 'react-i18next' +import { Trans, translate } from 'react-i18next' import styled from 'styled-components' import moment from 'moment' import { getOperationAmountNumber } from '@ledgerhq/live-common/lib/operation' @@ -114,7 +114,7 @@ type Props = { const OperationDetails = connect(mapStateToProps)((props: Props) => { const { t, onClose, operation, account, currencySettings, marketIndicator } = props if (!operation || !account || !currencySettings) return null - const { hash, date, senders, type, fee, recipients } = operation + const { extra, hash, date, senders, type, fee, recipients } = operation const { name, unit, currency } = account const amount = getOperationAmountNumber(operation) @@ -226,6 +226,14 @@ const OperationDetails = connect(mapStateToProps)((props: Props) => { {t('operationDetails.to')} + {Object.entries(extra).map(([key, value]) => ( + + + + + {value} + + ))} From 49f2a27561b99e93f9499d4fa3e4f48b69b79f81 Mon Sep 17 00:00:00 2001 From: Juan Cortes Ross Date: Tue, 11 Dec 2018 17:16:18 +0100 Subject: [PATCH 2/2] Update RippleJSBridge.js --- src/bridge/RippleJSBridge.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/bridge/RippleJSBridge.js b/src/bridge/RippleJSBridge.js index 9dfd34c5..31c9c356 100644 --- a/src/bridge/RippleJSBridge.js +++ b/src/bridge/RippleJSBridge.js @@ -121,7 +121,11 @@ async function signAndBroadcast({ a, t, deviceId, isCancelled, onSigned, onOpera transactionSequenceNumber: (a.operations.length > 0 ? a.operations[0].transactionSequenceNumber : 0) + a.pendingOperations.length, - extra: { tag: t.tag }, + extra: {}, + } + + if (t.tag) { + op.extra.tag = t.tag } onOperationBroadcasted(op) } @@ -234,7 +238,11 @@ const txToOperation = (account: Account) => ({ recipients: [destination.address], date: new Date(timestamp), transactionSequenceNumber: sequence, - extra: { tag: destination.tag }, + extra: {}, + } + + if (destination.tag) { + op.extra.tag = destination.tag } return op }