Let SplashScreen trigger render of App
The splash screen will soon poll for loading progress info, so we might as well launch App directly from SplashScreen instead of having two separate polls.
This commit is contained in:
parent
7c1fb5bcb2
commit
8deb62cc76
2 changed files with 7 additions and 5 deletions
|
@ -15,6 +15,10 @@ var splashStyle = {
|
|||
var SplashScreen = React.createClass({
|
||||
propTypes: {
|
||||
message: React.PropTypes.string,
|
||||
onLoadDone: React.PropTypes.func,
|
||||
},
|
||||
componentDidMount: function() {
|
||||
lbry.connect(this.props.onLoadDone);
|
||||
},
|
||||
render: function() {
|
||||
var imgSrc = lbry.imagePath('lbry-white-485x160.png');
|
||||
|
|
|
@ -3,13 +3,11 @@ var init = function() {
|
|||
var canvas = document.getElementById('canvas');
|
||||
|
||||
ReactDOM.render(
|
||||
<SplashScreen message="Connecting"/>,
|
||||
<SplashScreen message="Connecting" onLoadDone={function() {
|
||||
ReactDOM.render(<App/>, canvas);
|
||||
}}/>,
|
||||
canvas
|
||||
);
|
||||
|
||||
lbry.connect(function() {
|
||||
ReactDOM.render(<App/>, canvas);
|
||||
})
|
||||
};
|
||||
|
||||
init();
|
||||
|
|
Loading…
Add table
Reference in a new issue