From 8deb62cc769219a7832ce72b8fa557bd3ef42377 Mon Sep 17 00:00:00 2001 From: Alex Liebowitz Date: Thu, 14 Apr 2016 01:49:00 -0400 Subject: [PATCH] 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. --- js/component/splash.js | 4 ++++ js/main.js | 8 +++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/js/component/splash.js b/js/component/splash.js index b3cc102f6..e1838e912 100644 --- a/js/component/splash.js +++ b/js/component/splash.js @@ -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'); diff --git a/js/main.js b/js/main.js index 4d9679c22..6305ccfa3 100644 --- a/js/main.js +++ b/js/main.js @@ -3,13 +3,11 @@ var init = function() { var canvas = document.getElementById('canvas'); ReactDOM.render( - , + , canvas); + }}/>, canvas ); - - lbry.connect(function() { - ReactDOM.render(, canvas); - }) }; init();