Commit b627e5e5 authored by Romain Courteaud's avatar Romain Courteaud

XXX erp5_web_renderjs_ui: prototype offline status

parent 8b3bf349
...@@ -902,6 +902,26 @@ ...@@ -902,6 +902,26 @@
gadget.state.notification_options : undefined, gadget.state.notification_options : undefined,
// Force calling main gadget render // Force calling main gadget render
render_timestamp: new Date().getTime() render_timestamp: new Date().getTime()
})
.push(undefined, function (error) {
if (!navigator.onLine) {
return route(gadget, 'translation_gadget', 'translate',
['You are offline.'])
.push(function (message) {
return route(gadget, "notification", 'notify',
[{
"message": message,
"status": "error"
}]);
})
.push(function () {
return rJS.loopEventListener(window, 'online', false,
function backOnline() {
return location.reload();
});
});
}
throw error;
}) })
.push(undefined, function (error) { .push(undefined, function (error) {
return displayError(gadget, error); return displayError(gadget, error);
......
...@@ -234,7 +234,7 @@ ...@@ -234,7 +234,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>995.60357.5039.47650</string> </value> <value> <string>993.37256.4522.58726</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -252,7 +252,7 @@ ...@@ -252,7 +252,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1639487214.66</float> <float>1626860658.98</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