Commit 1ed4cce0 authored by Roque's avatar Roque

erp5_officejs_appstore_base: handle service worker registration error

parent e89e053a
/*globals window, document, RSVP, rJS, navigator*/ /*globals window, document, RSVP, rJS, navigator, console*/
/*jslint indent: 2, maxlen: 80, nomen: true*/ /*jslint indent: 2, maxlen: 80, nomen: true*/
(function (window, document, RSVP, rJS, navigator) { (function (window, document, RSVP, rJS, navigator, console) {
"use strict"; "use strict";
rJS(window) rJS(window)
...@@ -13,8 +13,13 @@ ...@@ -13,8 +13,13 @@
// Make this redirection compatible with no-service-worker browsers // Make this redirection compatible with no-service-worker browsers
if ('serviceWorker' in navigator) { if ('serviceWorker' in navigator) {
queue.push(function () { queue.push(function () {
return navigator.serviceWorker.register( return navigator.serviceWorker
"gadget_erp5_serviceworker.js"); .register("gadget_erp5_serviceworker.js");
})
.push(undefined, function (error) {
// If service worker installation is rejected,
// do not prevent the site to be usable, even if slower
console.warn("Service worker registration failed", error);
}); });
} }
return queue return queue
...@@ -24,4 +29,4 @@ ...@@ -24,4 +29,4 @@
}); });
}); });
}(window, document, RSVP, rJS, navigator)); }(window, document, RSVP, rJS, navigator, console));
\ No newline at end of file \ No newline at end of file
...@@ -244,7 +244,7 @@ ...@@ -244,7 +244,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>996.52764.3468.58419</string> </value> <value> <string>997.60607.41300.1194</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -262,7 +262,7 @@ ...@@ -262,7 +262,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1639416568.49</float> <float>1643817599.53</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment