Commit f4271a16 authored by Vincent Bechu's avatar Vincent Bechu

[erp5_officejs] Add test serviceWorker in navigator, in bootloader

parent becb33d7
......@@ -141,28 +141,31 @@ sub gadget does not have all aquired Method at this point*/
.declareMethod("install", function () {
var gadget = this,
storage = createStorage(gadget);
return new RSVP.Queue()
.push(function () {
return navigator.serviceWorker.register(
"gadget_officejs_bootloader_serviceworker.js"
);
})
.push(function () {
return storage.repair();
})
.push(undefined, function (error) {
return gadget.changeState({
retry: gadget.state.retry !== undefined ?
gadget.state.retry + 1 : 0,
error: error
if (navigator.serviceWorker !== undefined) {
return new RSVP.Queue()
.push(function () {
return navigator.serviceWorker.register(
"gadget_officejs_bootloader_serviceworker.js"
);
})
.push(function () {
return storage.repair();
})
.push(function () {
return RSVP.delay(1000);
.push(undefined, function (error) {
return gadget.changeState({
retry: gadget.state.retry !== undefined ?
gadget.state.retry + 1 : 0,
error: error
})
.push(function () {
return gadget.install();
});
});
.push(function () {
return RSVP.delay(1000);
})
.push(function () {
return gadget.install();
});
});
}
return;
});
}(window, document, RSVP, rJS, jIO, navigator, URL));
\ No newline at end of file
......@@ -236,7 +236,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>961.19028.47293.9045</string> </value>
<value> <string>961.19383.11182.45687</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -254,7 +254,7 @@
</tuple>
<state>
<tuple>
<float>1502288666.48</float>
<float>1502291956.98</float>
<string>UTC</string>
</tuple>
</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