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:
parent
850df11f27
commit
d524c25258
3 changed files with 15 additions and 30 deletions
|
@ -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;
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue