Commit 88013405 authored by Vincent Bechu's avatar Vincent Bechu

[erp5_officejs] Bootloader, restart install when serviceworker registration fail

parent 53a4d1b1
...@@ -166,6 +166,11 @@ var repair = false; ...@@ -166,6 +166,11 @@ var repair = false;
storage = createStorage(gadget); storage = createStorage(gadget);
if (navigator.serviceWorker !== undefined) { if (navigator.serviceWorker !== undefined) {
return storage.repair() return storage.repair()
.push(function () {
return navigator.serviceWorker.register(
"gadget_officejs_bootloader_serviceworker.js"
);
})
.push(undefined, function (error) { .push(undefined, function (error) {
return gadget.changeState({ return gadget.changeState({
error_amount: gadget.state.error_amount + 1, error_amount: gadget.state.error_amount + 1,
...@@ -177,11 +182,6 @@ var repair = false; ...@@ -177,11 +182,6 @@ var repair = false;
.push(function () { .push(function () {
return gadget.install(); return gadget.install();
}); });
})
.push(function () {
return navigator.serviceWorker.register(
"gadget_officejs_bootloader_serviceworker.js"
);
}); });
} }
return; return;
......
...@@ -222,7 +222,7 @@ ...@@ -222,7 +222,7 @@
</item> </item>
<item> <item>
<key> <string>actor</string> </key> <key> <string>actor</string> </key>
<value> <string>zope</string> </value> <value> <string>vincent</string> </value>
</item> </item>
<item> <item>
<key> <string>comment</string> </key> <key> <string>comment</string> </key>
...@@ -236,7 +236,7 @@ ...@@ -236,7 +236,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>962.14302.13214.21742</string> </value> <value> <string>963.20662.59245.4181</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -254,7 +254,7 @@ ...@@ -254,7 +254,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1506412140.67</float> <float>1510149659.24</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