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