1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00
jellyfin-web/src/scripts/settings/webSettings.js

19 lines
468 B
JavaScript
Raw Normal View History

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
});
}