mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
fix possible async issue
This commit is contained in:
parent
79aa40465c
commit
53db7fe215
1 changed files with 13 additions and 3 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue