lbry-desktop/js/main.js

26 lines
723 B
JavaScript
Raw Normal View History

2016-03-14 23:05:24 +01:00
//main.js
var init = function() {
var canvas = document.getElementById('canvas');
ReactDOM.render(
<SplashScreen message="Connecting" onLoadDone={function() {
2016-07-04 17:29:58 +02:00
// On home page, if the balance is 0, display claim code page instead of home page.
// Find somewhere better for this logic
2016-08-08 02:57:12 +02:00
if (window.location.search == '' || window.location.search == '?' || window.location.search == 'discover') {
2016-07-04 17:29:58 +02:00
lbry.getBalance((balance) => {
if (balance <= 0) {
window.location.href = '?claim';
} else {
ReactDOM.render(<App/>, canvas);
}
});
} else {
ReactDOM.render(<App/>, canvas);
}
}}/>,
2016-03-14 23:05:24 +01:00
canvas
);
};
init();