add loading message to the My Files page

This commit is contained in:
Sonata Green 2016-08-19 20:48:08 -05:00
parent 02416f66e5
commit 920f55b4f5
2 changed files with 25 additions and 1 deletions

View file

@ -158,7 +158,11 @@ var MyFilesPage = React.createClass({
},
render: function() {
if (this.state.filesInfo === null) {
return null;
return (
<main className="page">
<span>Loading...</span>
</main>
);
}
if (!this.state.filesInfo.length) {

View file

@ -117,6 +117,7 @@ var WalletPage = React.createClass({
getInitialState: function() {
return {
balance: "Checking balance...",
txlog: "Loading transactions...",
}
},
componentWillMount: function() {
@ -125,6 +126,21 @@ var WalletPage = React.createClass({
balance: results,
});
});
console.log('Trying to get transaction history...')
lbry.call('get_transaction_history', {}, (results) => {
console.log('Got transaction history:')
console.log(results)
var out = 'Transaction history loaded.'
if (results.length == 0) {
out = 'No transactions yet.'
} else {
out = JSON.stringify(results)
}
console.log(out)
this.setState({
txlog: out,
})
});
},
render: function() {
return (
@ -139,6 +155,10 @@ var WalletPage = React.createClass({
<h3>Claim Invite Code</h3>
<Link href="?claim" label="Claim a LBRY beta invite code" button="alt" />
</section>
<section className="card">
<h3>Transaction History</h3>
{this.state.txlog}
</section>
</main>
);
}