Commit e3831051 authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web_renderjs_ui] Router: reduce number of acquired method calls

parent 07c84e19
...@@ -1081,14 +1081,11 @@ ...@@ -1081,14 +1081,11 @@
.declareMethod('start', function start() { .declareMethod('start', function start() {
var gadget = this; var gadget = this;
return new RSVP.Queue() return gadget.getSettingList([
.push(function () { "selected_language",
return RSVP.all([ "default_selected_language",
gadget.getSetting("selected_language"), "language_map"
gadget.getSetting("default_selected_language"), ])
gadget.getSetting("language_map")
]);
})
.push(function (results) { .push(function (results) {
if (results[1] !== results[0] && results[0] && JSON.parse(results[2]).hasOwnProperty(results[0])) { if (results[1] !== results[0] && results[0] && JSON.parse(results[2]).hasOwnProperty(results[0])) {
return gadget.redirect({ return gadget.redirect({
...@@ -1116,6 +1113,7 @@ ...@@ -1116,6 +1113,7 @@
.declareAcquiredMethod('jio_getAttachment', 'jio_getAttachment') .declareAcquiredMethod('jio_getAttachment', 'jio_getAttachment')
.declareAcquiredMethod('setSetting', 'setSetting') .declareAcquiredMethod('setSetting', 'setSetting')
.declareAcquiredMethod('getSetting', 'getSetting') .declareAcquiredMethod('getSetting', 'getSetting')
.declareAcquiredMethod('getSettingList', 'getSettingList')
.declareAcquiredMethod('renderError', 'reportServiceError') .declareAcquiredMethod('renderError', 'reportServiceError')
.declareAcquiredMethod('translate', 'translate') .declareAcquiredMethod('translate', 'translate')
.declareAcquiredMethod('isDesktopMedia', 'isDesktopMedia') .declareAcquiredMethod('isDesktopMedia', 'isDesktopMedia')
......
...@@ -232,7 +232,7 @@ ...@@ -232,7 +232,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>971.50995.42315.11776</string> </value> <value> <string>971.58160.33555.10956</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -250,7 +250,7 @@ ...@@ -250,7 +250,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1543248439.12</float> <float>1543249005.07</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