Shall service api unified with Chromecast

This commit is contained in:
nklhrstv 2020-05-12 15:55:30 +03:00
parent 215bd79144
commit 53e8399bd3

View file

@ -6,6 +6,7 @@ function Shell() {
let active = false; let active = false;
let error = null; let error = null;
let starting = false; let starting = false;
const events = new EventEmitter(); const events = new EventEmitter();
events.on('error', () => { }); events.on('error', () => { });
@ -17,12 +18,10 @@ function Shell() {
return; return;
} }
starting = true; active = false;
setTimeout(() => { error = new Error('Stremio shell not available');
error = new Error('Unable to init stremio shell'); starting = false;
starting = false; onStateChanged();
onStateChanged();
});
} }
function stop() { function stop() {
active = false; active = false;
@ -58,6 +57,13 @@ function Shell() {
get: function() { get: function() {
return error; return error;
} }
},
starting: {
configurable: false,
enumerable: true,
get: function() {
return starting;
}
} }
}); });
@ -66,8 +72,6 @@ function Shell() {
this.on = on; this.on = on;
this.off = off; this.off = off;
this.dispatch = dispatch; this.dispatch = dispatch;
Object.freeze(this);
} }
module.exports = Shell; module.exports = Shell;