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
isekai-main
Opliko 2 years ago committed by GitHub
parent e7806021c9
commit 1920732528
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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",

@ -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([

Loading…
Cancel
Save