Skip to content

Commit

Permalink
More removal of redundant code
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Friedman <[email protected]>
  • Loading branch information
iMattPro committed May 28, 2024
1 parent c4b60d1 commit 389d4ef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
6 changes: 3 additions & 3 deletions styles/all/template/update_worker.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
'use strict';

/* global phpbbWebpushOptions, domReady */
function webpushWorkerUpdate() {
if ('serviceWorker' in navigator) {
navigator.serviceWorker.getRegistration(serviceWorkerUrl)
navigator.serviceWorker.getRegistration(phpbbWebpushOptions.serviceWorkerUrl)
.then((registration) => {
registration.update();
})
Expand All @@ -20,10 +21,9 @@ if (typeof domReady === 'undefined') {
} else {
callBack();
}
}
};
}

domReady(() => {
/* global serviceWorkerUrl */
webpushWorkerUpdate();
});
3 changes: 0 additions & 3 deletions styles/prosilver/template/event/overall_footer_after.html
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
<script>
const serviceWorkerUrl = '{{ U_WEBPUSH_WORKER_URL }}';
</script>
{% INCLUDEJS('@phpbb_webpushnotifications/update_worker.js') %}

0 comments on commit 389d4ef

Please sign in to comment.