);
}
});
var WalletPage = React.createClass({
componentDidMount: function() {
document.title = "My Wallet";
},
/*
Below should be refactored so that balance is shared all of wallet page. Or even broader?
What is the proper React pattern for sharing a global state like balance?
*/
getInitialState: function() {
return {
balance: "Checking balance...",
txlog: "Loading transactions...",
}
},
componentWillMount: function() {
lbry.getBalance((results) => {
this.setState({
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 (