Browse Source

Moved transaction time

acinq
Marcos Rodriguez Vélez 6 years ago
parent
commit
d986b2177f
  1. 7
      loc/index.js
  2. 7
      screen/wallets/transactions.js

7
loc/index.js

@ -164,13 +164,6 @@ strings.transactionTimeToReadable = time => {
return dayjs(time).fromNow(); return dayjs(time).fromNow();
}; };
strings.transactionTimeToReadableToFuture = time => {
if (time === 0) {
return strings._.never;
}
return dayjs(time).toNow();
};
function removeTrailingZeros(value) { function removeTrailingZeros(value) {
value = value.toString(); value = value.toString();

7
screen/wallets/transactions.js

@ -61,7 +61,7 @@ export default class WalletTransactions extends Component {
wallet: wallet, wallet: wallet,
dataSource: wallet.getTransactions(), dataSource: wallet.getTransactions(),
walletPreviousPreferredUnit: wallet.getPreferredBalanceUnit(), walletPreviousPreferredUnit: wallet.getPreferredBalanceUnit(),
walletHeaderLatestTransaction: '', walletHeaderLatestTransaction: '...',
showSendButton: showSendButton:
(wallet.allowSend() && wallet.type === LightningCustodianWallet.type && wallet.balance > 0) || (wallet.allowSend() && wallet.type === LightningCustodianWallet.type && wallet.balance > 0) ||
(wallet.allowSend() && wallet.type !== LightningCustodianWallet.type), (wallet.allowSend() && wallet.type !== LightningCustodianWallet.type),
@ -71,9 +71,6 @@ export default class WalletTransactions extends Component {
componentDidMount() { componentDidMount() {
this.refreshFunction(); this.refreshFunction();
InteractionManager.runAfterInteractions(() => {
this.setState({ walletHeaderLatestTransaction: loc.transactionTimeToReadable(this.state.wallet.getLatestTransactionTime()) });
});
} }
/** /**
@ -121,6 +118,7 @@ export default class WalletTransactions extends Component {
} catch (error) { } catch (error) {
console.log(error); console.log(error);
} }
const latestTXTime = loc.transactionTimeToReadable(wallet.getLatestTransactionTime());
this.setState({ this.setState({
isLoading: false, isLoading: false,
showShowFlatListRefreshControl: false, showShowFlatListRefreshControl: false,
@ -129,6 +127,7 @@ export default class WalletTransactions extends Component {
showManageFundsBigButton, showManageFundsBigButton,
showManageFundsSmallButton, showManageFundsSmallButton,
dataSource: txs, dataSource: txs,
walletHeaderLatestTransaction: latestTXTime,
}); });
}); });
} }

Loading…
Cancel
Save