|
@@ -48,9 +48,17 @@ 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
|
|
|
+ return;
|
|
|
+ }
|
|
|
this._refreshRunning();
|
|
|
}, 10000);
|
|
|
this._specsTimer = (setInterval as any)(() => {
|
|
|
+ if (typeof document !== 'undefined' && !document.hasFocus()) {
|
|
|
+ // don't poll when nobody's looking
|
|
|
+ return;
|
|
|
+ }
|
|
|
this._refreshSpecs();
|
|
|
}, 61000);
|
|
|
}
|