2020-04-02 19:44:21 +09:00
|
|
|
let data;
|
|
|
|
|
2020-04-02 03:51:22 +09:00
|
|
|
function getConfig() {
|
2020-04-02 19:44:21 +09:00
|
|
|
if (data) return Promise.resolve(data);
|
2020-05-04 12:44:12 +02:00
|
|
|
return fetch('/config.json?nocache=' + new Date().getUTCMilliseconds()).then(function (response) {
|
2020-04-02 19:50:09 +09:00
|
|
|
data = response.json();
|
|
|
|
return data;
|
2020-04-02 03:51:22 +09:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
export function enableMultiServer() {
|
|
|
|
return getConfig().then(config => {
|
|
|
|
return config.multiserver;
|
2020-04-24 13:46:57 +03:00
|
|
|
}).catch(error => {
|
2020-05-04 12:44:12 +02:00
|
|
|
console.log('cannot get web config:', error);
|
2020-04-24 13:46:57 +03:00
|
|
|
return false;
|
2020-04-02 03:51:22 +09:00
|
|
|
});
|
|
|
|
}
|