feat: remove visibilityjs (#10870)

* feat: remove visibilityjs

* fix: actually remove require

* style: add a newline

* style: forgot a semicolon

* style: accidently removed trailing newline

* fix: move property declaration to its actual previous place
This commit is contained in:
Opliko
2022-08-30 16:52:57 +03:00
committed by GitHub
parent e7806021c9
commit 1920732528
2 changed files with 5 additions and 7 deletions

View File

@@ -134,7 +134,6 @@
"toobusy-js": "0.5.1",
"uglify-es": "3.3.9",
"validator": "13.7.0",
"visibilityjs": "2.0.2",
"webpack": "5.74.0",
"webpack-merge": "5.8.0",
"winston": "3.8.1",

View File

@@ -9,7 +9,6 @@ require('jquery-form');
window.utils = require('./utils');
require('timeago');
const Visibility = require('visibilityjs');
const Benchpress = require('benchpressjs');
Benchpress.setGlobal('config', config);
@@ -19,7 +18,11 @@ require('./ajaxify');
app = window.app || {};
app.isFocused = true;
Object.defineProperty(app, 'isFocused', {
get() {
return document.visibilityState === 'visible';
}
});
app.currentRoom = null;
app.widgets = {};
app.flags = {};
@@ -95,10 +98,6 @@ if (document.readyState === 'loading') {
app.newTopic();
});
Visibility.change(function (event, state) {
app.isFocused = state === 'visible';
});
registerServiceWorker();
require([