mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-17 10:58:20 -07:00
fix possible async issue
This commit is contained in:
parent
79aa40465c
commit
53db7fe215
@ -1,16 +1,26 @@
|
||||
define(['appStorage', 'events'], function (appStorage, events) {
|
||||
'use strict';
|
||||
|
||||
var data = {};
|
||||
var data;
|
||||
|
||||
function getConfig() {
|
||||
if (data) {
|
||||
return data;
|
||||
}
|
||||
|
||||
function WebSettings() {
|
||||
fetch("/config.json").then(function (response) {
|
||||
data = response.json();
|
||||
})
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function WebSettings() {
|
||||
getConfig();
|
||||
}
|
||||
|
||||
WebSettings.prototype.enableMultiServer = function () {
|
||||
return data.multiServer || false;
|
||||
return getConfig().multiServer || false;
|
||||
};
|
||||
|
||||
return new WebSettings();
|
||||
|
Loading…
Reference in New Issue
Block a user