From f34d0c9ad84f8cff2980147037bb2af73e1f0922 Mon Sep 17 00:00:00 2001 From: Alex Liebowitz Date: Thu, 14 Apr 2016 04:21:36 -0400 Subject: [PATCH] Add details from daemon to splash message --- js/component/splash.js | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/js/component/splash.js b/js/component/splash.js index 7276779fc..de529dae7 100644 --- a/js/component/splash.js +++ b/js/component/splash.js @@ -9,7 +9,11 @@ var splashStyle = { alignItems: 'center', justifyContent: 'center' }, splashMessageStyle = { - marginTop: '24px' + marginTop: '24px', + width: '325px', + textAlign: 'center', +}, splashDetailsStyle = { + color: '#c3c3c3', }; var SplashScreen = React.createClass({ @@ -17,6 +21,11 @@ var SplashScreen = React.createClass({ message: React.PropTypes.string, onLoadDone: React.PropTypes.func, }, + getInitialState: function() { + return { + details: 'Starting daemon' + } + }, updateStatus: function(checkNum=0, was_lagging=false) { lbry.getDaemonStatus((status) => { if (status.code == 'started') { @@ -24,8 +33,14 @@ var SplashScreen = React.createClass({ return; } - if (!was_lagging && status.is_lagging) { // We just started lagging - alert(status.message); + if (status.is_lagging) { + if (!was_lagging) { // We just started lagging, so display message as alert + alert(status.message); + } + } else { // Not lagging, so display the message normally + this.setState({ + details: status.message + }); } if (checkNum < 600) { @@ -48,6 +63,7 @@ var SplashScreen = React.createClass({ {this.props.message} + {this.state.details}... );