From fca7906f76ce34d3cbc299f758b8465bfac8fcd9 Mon Sep 17 00:00:00 2001 From: Andy Phillipson Date: Fri, 26 May 2017 10:15:24 -0400 Subject: [PATCH] Ensure no floating comma in tx history (wavecrest does not provide merchant location). --- src/js/controllers/bitpayCard.js | 6 ++++++ www/views/bitpayCard.html | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/js/controllers/bitpayCard.js b/src/js/controllers/bitpayCard.js index 05a823a3e..a0357c77a 100644 --- a/src/js/controllers/bitpayCard.js +++ b/src/js/controllers/bitpayCard.js @@ -77,6 +77,12 @@ angular.module('copayApp.controllers').controller('bitpayCardController', functi txs[i].price = _price(txs[i]); txs[i].runningBalance = runningBalance; _runningBalance(txs[i]); + + if (txs[i].merchant.city && txs[i].merchant.state) { + txs[i].merchant.location = txs[i].merchant.city + ', ' + txs[i].merchant.state; + } else { + txs[i].merchant.location = txs[i].merchant.city || txs[i].merchant.state || ''; + } } self.bitpayCardTransactionHistory = txs; self.balance = history.currentCardBalance; diff --git a/www/views/bitpayCard.html b/www/views/bitpayCard.html index 8044550e4..1867b16df 100644 --- a/www/views/bitpayCard.html +++ b/www/views/bitpayCard.html @@ -79,7 +79,7 @@ {{tx.merchant.name}}
- {{tx.merchant.city}}, {{tx.merchant.state}} + {{tx.merchant.location}} {{tx.timestamp | amDateFormat:'h:mm A'}}