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

port web settings to es6

This commit is contained in:
dkanada 2020-04-02 03:51:22 +09:00
parent 850df11f27
commit d524c25258
3 changed files with 15 additions and 30 deletions

View file

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