2016-03-14 23:05:24 +01:00
|
|
|
//main.js
|
|
|
|
var init = function() {
|
|
|
|
var canvas = document.getElementById('canvas');
|
|
|
|
|
|
|
|
ReactDOM.render(
|
2016-04-14 07:49:00 +02:00
|
|
|
<SplashScreen message="Connecting" onLoadDone={function() {
|
2016-09-02 09:08:46 +02:00
|
|
|
// Redirect to the claim code page if needed. Find somewhere better for this logic
|
|
|
|
if (!localStorage.getItem('claimCodeDone') && 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-04-14 07:49:00 +02:00
|
|
|
}}/>,
|
2016-03-14 23:05:24 +01:00
|
|
|
canvas
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
2016-04-12 10:52:42 +02:00
|
|
|
init();
|