mirror of
https://github.com/LBRYFoundation/lbry-desktop.git
synced 2025-09-01 09:45:10 +00:00
Add details from daemon to splash message
This commit is contained in:
parent
3b705ada7b
commit
f34d0c9ad8
1 changed files with 19 additions and 3 deletions
|
@ -9,7 +9,11 @@ var splashStyle = {
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
justifyContent: 'center'
|
justifyContent: 'center'
|
||||||
}, splashMessageStyle = {
|
}, splashMessageStyle = {
|
||||||
marginTop: '24px'
|
marginTop: '24px',
|
||||||
|
width: '325px',
|
||||||
|
textAlign: 'center',
|
||||||
|
}, splashDetailsStyle = {
|
||||||
|
color: '#c3c3c3',
|
||||||
};
|
};
|
||||||
|
|
||||||
var SplashScreen = React.createClass({
|
var SplashScreen = React.createClass({
|
||||||
|
@ -17,6 +21,11 @@ var SplashScreen = React.createClass({
|
||||||
message: React.PropTypes.string,
|
message: React.PropTypes.string,
|
||||||
onLoadDone: React.PropTypes.func,
|
onLoadDone: React.PropTypes.func,
|
||||||
},
|
},
|
||||||
|
getInitialState: function() {
|
||||||
|
return {
|
||||||
|
details: 'Starting daemon'
|
||||||
|
}
|
||||||
|
},
|
||||||
updateStatus: function(checkNum=0, was_lagging=false) {
|
updateStatus: function(checkNum=0, was_lagging=false) {
|
||||||
lbry.getDaemonStatus((status) => {
|
lbry.getDaemonStatus((status) => {
|
||||||
if (status.code == 'started') {
|
if (status.code == 'started') {
|
||||||
|
@ -24,8 +33,14 @@ var SplashScreen = React.createClass({
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!was_lagging && status.is_lagging) { // We just started lagging
|
if (status.is_lagging) {
|
||||||
alert(status.message);
|
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) {
|
if (checkNum < 600) {
|
||||||
|
@ -48,6 +63,7 @@ var SplashScreen = React.createClass({
|
||||||
{this.props.message}
|
{this.props.message}
|
||||||
<span className="busy-indicator"></span>
|
<span className="busy-indicator"></span>
|
||||||
</h3>
|
</h3>
|
||||||
|
<span style={splashDetailsStyle}>{this.state.details}...</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Reference in a new issue