only show the splash screen on initial load
This commit is contained in:
parent
4ee729fb81
commit
9979315d6a
2 changed files with 21 additions and 17 deletions
|
@ -28,6 +28,7 @@ var SplashScreen = React.createClass({
|
||||||
});
|
});
|
||||||
|
|
||||||
lbry.resolveName('one', () => {
|
lbry.resolveName('one', () => {
|
||||||
|
window.sessionStorage.setItem('loaded', 'y')
|
||||||
this.props.onLoadDone();
|
this.props.onLoadDone();
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
|
|
37
js/main.js
37
js/main.js
|
@ -13,24 +13,27 @@ var init = function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
var canvas = document.getElementById('canvas');
|
var canvas = document.getElementById('canvas');
|
||||||
|
if (window.sessionStorage.getItem('loaded') == 'y') {
|
||||||
ReactDOM.render(
|
ReactDOM.render(<App/>, canvas)
|
||||||
<SplashScreen message="Connecting" onLoadDone={function() {
|
} else {
|
||||||
// Redirect to the claim code page if needed. Find somewhere better for this logic
|
ReactDOM.render(
|
||||||
if (!localStorage.getItem('claimCodeDone') && window.location.search == '' || window.location.search == '?' || window.location.search == 'discover') {
|
<SplashScreen message="Connecting" onLoadDone={function() {
|
||||||
lbry.getBalance((balance) => {
|
// Redirect to the claim code page if needed. Find somewhere better for this logic
|
||||||
if (balance <= 0) {
|
if (!localStorage.getItem('claimCodeDone') && window.location.search == '' || window.location.search == '?' || window.location.search == 'discover') {
|
||||||
window.location.href = '?claim';
|
lbry.getBalance((balance) => {
|
||||||
} else {
|
if (balance <= 0) {
|
||||||
|
window.location.href = '?claim';
|
||||||
|
} else {
|
||||||
|
ReactDOM.render(<App/>, canvas);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
ReactDOM.render(<App/>, canvas);
|
ReactDOM.render(<App/>, canvas);
|
||||||
}
|
}
|
||||||
});
|
}}/>,
|
||||||
} else {
|
canvas
|
||||||
ReactDOM.render(<App/>, canvas);
|
);
|
||||||
}
|
}
|
||||||
}}/>,
|
|
||||||
canvas
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
init();
|
init();
|
||||||
|
|
Loading…
Add table
Reference in a new issue