From 9f69e4e56270283d173782a8fa9a13a6913cbd4b Mon Sep 17 00:00:00 2001 From: Wei Lu Date: Mon, 27 Jul 2015 00:00:51 +0800 Subject: [PATCH] UI: display loading message in history tab --- app/pages/history/index.js | 5 ++++- app/pages/history/index.ract | 17 ++++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/app/pages/history/index.js b/app/pages/history/index.js index 410c5e40..f4f6589d 100644 --- a/app/pages/history/index.js +++ b/app/pages/history/index.js @@ -19,17 +19,20 @@ module.exports = function(el){ var date = new Date(timestamp) return strftime('%b %d %l:%M %p', date) }, - satoshiToBtc: satoshiToBtc + satoshiToBtc: satoshiToBtc, + loadingTx: true } }) emitter.on('append-transactions', function(newTxs){ Array.prototype.unshift.apply(transactions, newTxs) ractive.set('transactions', transactions) + ractive.set('loadingTx', false) }) emitter.on('set-transactions', function(newTxs) { ractive.set('transactions', newTxs) + ractive.set('loadingTx', false) }) ractive.on('show-detail', function(event) { diff --git a/app/pages/history/index.ract b/app/pages/history/index.ract index 9ee7d906..115f4c24 100644 --- a/app/pages/history/index.ract +++ b/app/pages/history/index.ract @@ -1,5 +1,10 @@
+ {{#loadingTx}} +
+
{{translate("Loading transactions...")}}
+
+ {{/loadingTx}} {{#transactions.length}}

{{translate("Your transaction history")}}

{{/transactions.length}} @@ -27,11 +32,13 @@
{{/transactions}} {{^transactions}} -
-
- {{>svg_help}} + {{^loadingTx}} +
+
+ {{>svg_help}} +
+
{{translate("You do not have any transactions yet")}}
-
{{translate("You do not have any transactions yet")}}
-
+ {{/loadingTx}} {{/transactions}}