[ticket/17321] Fix eslint issues

PHPBB3-17321
This commit is contained in:
rxu 2024-05-27 14:40:29 +07:00
parent ad715dac08
commit 3973fbe649
No known key found for this signature in database
GPG key ID: 8117904FEDEFDD17

View file

@ -3,7 +3,7 @@
function webpushWorkerUpdate() { function webpushWorkerUpdate() {
if ('serviceWorker' in navigator) { if ('serviceWorker' in navigator) {
navigator.serviceWorker.getRegistration(serviceWorkerUrl) navigator.serviceWorker.getRegistration(serviceWorkerUrl)
.then((registration) => { .then(registration => {
registration.update(); registration.update();
}) })
.catch(error => { .catch(error => {
@ -12,6 +12,7 @@ function webpushWorkerUpdate() {
}); });
} }
} }
// Do not redeclare function if exist // Do not redeclare function if exist
if (typeof domReady === 'undefined') { if (typeof domReady === 'undefined') {
window.domReady = function(callBack) { window.domReady = function(callBack) {
@ -20,9 +21,10 @@ if (typeof domReady === 'undefined') {
} else { } else {
callBack(); callBack();
} }
} };
} }
/* global domReady */
domReady(() => { domReady(() => {
/* global serviceWorkerUrl */ /* global serviceWorkerUrl */
webpushWorkerUpdate(); webpushWorkerUpdate();