Skip to content
This repository has been archived by the owner on Jan 3, 2019. It is now read-only.

Commit

Permalink
UI: display loading message in history tab
Browse files Browse the repository at this point in the history
  • Loading branch information
weilu committed Jul 26, 2015
1 parent eb2ad98 commit 9f69e4e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
5 changes: 4 additions & 1 deletion app/pages/history/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
17 changes: 12 additions & 5 deletions app/pages/history/index.ract
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@

<div class="transactions">
{{#loadingTx}}
<div class="transactions__message">
<div class="_message">{{translate("Loading transactions...")}}</div>
</div>
{{/loadingTx}}
{{#transactions.length}}
<h3 class="_title">{{translate("Your transaction history")}}</h3>
{{/transactions.length}}
Expand Down Expand Up @@ -27,11 +32,13 @@
</div>
{{/transactions}}
{{^transactions}}
<div class="transactions__message">
<div class="_icon">
{{>svg_help}}
{{^loadingTx}}
<div class="transactions__message">
<div class="_icon">
{{>svg_help}}
</div>
<div class="_message">{{translate("You do not have any transactions yet")}}</div>
</div>
<div class="_message">{{translate("You do not have any transactions yet")}}</div>
</div>
{{/loadingTx}}
{{/transactions}}
</div>

0 comments on commit 9f69e4e

Please sign in to comment.