mirror of
https://github.com/LBRYFoundation/lbry-desktop.git
synced 2025-09-07 02:59:49 +00:00
Basic load status checking logic and notify user when lagging
This commit is contained in:
parent
8deb62cc76
commit
3b705ada7b
1 changed files with 19 additions and 1 deletions
|
@ -17,8 +17,26 @@ var SplashScreen = React.createClass({
|
||||||
message: React.PropTypes.string,
|
message: React.PropTypes.string,
|
||||||
onLoadDone: React.PropTypes.func,
|
onLoadDone: React.PropTypes.func,
|
||||||
},
|
},
|
||||||
|
updateStatus: function(checkNum=0, was_lagging=false) {
|
||||||
|
lbry.getDaemonStatus((status) => {
|
||||||
|
if (status.code == 'started') {
|
||||||
|
this.props.onLoadDone();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!was_lagging && status.is_lagging) { // We just started lagging
|
||||||
|
alert(status.message);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (checkNum < 600) {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.updateStatus(checkNum + 1, status.is_lagging);
|
||||||
|
}, 500);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
componentDidMount: function() {
|
componentDidMount: function() {
|
||||||
lbry.connect(this.props.onLoadDone);
|
this.updateStatus();
|
||||||
},
|
},
|
||||||
render: function() {
|
render: function() {
|
||||||
var imgSrc = lbry.imagePath('lbry-white-485x160.png');
|
var imgSrc = lbry.imagePath('lbry-white-485x160.png');
|
||||||
|
|
Loading…
Add table
Reference in a new issue