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

fix wizard route and config load error

This commit is contained in:
dkanada 2020-05-12 06:28:14 +09:00
parent 0778406c16
commit 8c3e72fe7b
3 changed files with 44 additions and 32 deletions

View file

@ -2,7 +2,17 @@ let data;
function getConfig() {
if (data) return Promise.resolve(data);
return fetch('/config.json?nocache=' + new Date().getUTCMilliseconds()).then(function (response) {
return fetch('/config.json?nocache=' + new Date().getUTCMilliseconds()).then(response => {
data = response.json();
return data;
}).catch(error => {
return getDefaultConfig();
});
}
function getDefaultConfig() {
console.warn('web config file is missing so the template will be used')
return fetch('/config.template.json').then(function (response) {
data = response.json();
return data;
});