File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,14 +13,15 @@ function webpushWorkerUpdate() {
1313 }
1414}
1515// Do not redeclare function if exist
16+ /* global domReady */
1617if ( typeof domReady === 'undefined' ) {
1718 window . domReady = function ( callBack ) {
1819 if ( document . readyState === 'loading' ) {
1920 document . addEventListener ( 'DOMContentLoaded' , callBack ) ;
2021 } else {
2122 callBack ( ) ;
2223 }
23- }
24+ } ;
2425}
2526
2627domReady ( ( ) => {
Original file line number Diff line number Diff line change 1- < script >
2- const serviceWorkerUrl = '{{ U_WEBPUSH_WORKER_URL }}' ;
3- </ script >
4- {% INCLUDEJS('@phpbb_webpushnotifications/update_worker.js') %}
1+ {% if U_WEBPUSH_WORKER_URL %}
2+ < script >
3+ const serviceWorkerUrl = '{{ U_WEBPUSH_WORKER_URL }}' ;
4+ </ script >
5+ {% INCLUDEJS '@phpbb_webpushnotifications/update_worker.js' %}
6+ {% endif %}
Original file line number Diff line number Diff line change 1717 }
1818</ script >
1919
20- {% INCLUDEJS( '@phpbb_webpushnotifications/webpush.js') %}
21- {% INCLUDECSS( '@phpbb_webpushnotifications/phpbb_wpn.css') %}
20+ {% INCLUDEJS '@phpbb_webpushnotifications/webpush.js' %}
21+ {% INCLUDECSS '@phpbb_webpushnotifications/phpbb_wpn.css' %}
You can’t perform that action at this time.
0 commit comments