mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
removed import for config.json for fetch
This commit is contained in:
parent
9030aa2817
commit
723a19cd8b
2 changed files with 21 additions and 4 deletions
|
@ -43,9 +43,16 @@ async function fetchLocal(url, options) {
|
|||
async function getConfig() {
|
||||
if (data) return Promise.resolve(data);
|
||||
try {
|
||||
data = (await import('../../config.json')).default;
|
||||
const response = await fetchLocal('config.json', {
|
||||
cache: 'no-cache'
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error('network response was not ok');
|
||||
}
|
||||
|
||||
data = await response.json();
|
||||
|
||||
console.dir(data);
|
||||
return data;
|
||||
} catch (error) {
|
||||
console.warn('failed to fetch the web config file:', error);
|
||||
|
@ -55,9 +62,15 @@ async function getConfig() {
|
|||
|
||||
async function getDefaultConfig() {
|
||||
try {
|
||||
data = (await import('../../config.template.json')).default;
|
||||
const response = await fetchLocal('config.template.json', {
|
||||
cache: 'no-cache'
|
||||
});
|
||||
|
||||
console.dir(data);
|
||||
if (!response.ok) {
|
||||
throw new Error('network response was not ok');
|
||||
}
|
||||
|
||||
data = await response.json();
|
||||
return data;
|
||||
} catch (error) {
|
||||
console.error('failed to fetch the default web config file:', error);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue