port web settings to es6
This commit is contained in:
@@ -1,27 +1,11 @@
|
||||
define(['appStorage', 'events'], function (appStorage, events) {
|
||||
'use strict';
|
||||
function getConfig() {
|
||||
return fetch("/config.json?nocache=" + new Date().getUTCMilliseconds()).then(function (response) {
|
||||
return response.json();
|
||||
});
|
||||
}
|
||||
|
||||
var data;
|
||||
|
||||
function getConfig() {
|
||||
if (data) {
|
||||
return data;
|
||||
}
|
||||
|
||||
fetch("/config.json").then(function (response) {
|
||||
data = response.json();
|
||||
})
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function WebSettings() {
|
||||
getConfig();
|
||||
}
|
||||
|
||||
WebSettings.prototype.enableMultiServer = function () {
|
||||
return getConfig().multiServer || false;
|
||||
};
|
||||
|
||||
return new WebSettings();
|
||||
});
|
||||
export function enableMultiServer() {
|
||||
return getConfig().then(config => {
|
||||
return config.multiserver;
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user