|
@@ -48,15 +48,15 @@ class SessionManager implements Session.IManager {
|
|
|
|
|
|
// Set up polling.
|
|
|
this._modelsTimer = (setInterval as any)(() => {
|
|
|
- if (typeof document !== 'undefined' && !document.hasFocus()) {
|
|
|
- // don't poll when nobody's looking
|
|
|
+ if (typeof document !== 'undefined' && document.hidden) {
|
|
|
+ // Don't poll when nobody's looking.
|
|
|
return;
|
|
|
}
|
|
|
this._refreshRunning();
|
|
|
}, 10000);
|
|
|
this._specsTimer = (setInterval as any)(() => {
|
|
|
- if (typeof document !== 'undefined' && !document.hasFocus()) {
|
|
|
- // don't poll when nobody's looking
|
|
|
+ if (typeof document !== 'undefined' && document.hidden) {
|
|
|
+ // Don't poll when nobody's looking.
|
|
|
return;
|
|
|
}
|
|
|
this._refreshSpecs();
|