Commit baec601c authored by Piotr Gawron's avatar Piotr Gawron
Browse files

don't reload config when it's alread on client side

parent e8aa01b6
......@@ -930,12 +930,12 @@ ServerConnector.getConfigurationParam = function(paramId) {
return new Promise(function(resolve, reject) {
if (paramId === undefined) {
reject("Invalid param identifier");
}
if (self._configurationParam[paramId] !== undefined) {
} else if (self._configurationParam[paramId] !== undefined) {
resolve(self._configurationParam[paramId]);
}
self.getToken().then(function(token) {
self.readFile(self.getConfigurationUrl(token)).then(function(content) {
} else {
return self.getToken().then(function(token) {
return self.readFile(self.getConfigurationUrl(token));
}).then(function(content) {
var configs = JSON.parse(content);
for (var i = 0; i < configs.length; i++) {
var conf = configs[i];
......@@ -947,8 +947,8 @@ ServerConnector.getConfigurationParam = function(paramId) {
reject("Cannot find param config: " + paramId);
}
resolve(self._configurationParam[paramId]);
}, reject);
}, reject);
});
}
});
};
......
Supports Markdown
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