mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Add error logging for invalid config
This commit is contained in:
parent
0736069fd7
commit
8e8a5f61b9
1 changed files with 6 additions and 0 deletions
|
@ -110,6 +110,9 @@ const checkDefaultTheme = (themes) => {
|
|||
|
||||
export function getThemes() {
|
||||
return getConfig().then(config => {
|
||||
if (!Array.isArray(config.themes)) {
|
||||
console.error('web config is invalid, missing themes:', config);
|
||||
}
|
||||
const themes = Array.isArray(config.themes) ? config.themes : DefaultConfig.themes;
|
||||
checkDefaultTheme(themes);
|
||||
return themes;
|
||||
|
@ -124,6 +127,9 @@ export const getDefaultTheme = () => internalDefaultTheme;
|
|||
|
||||
export function getPlugins() {
|
||||
return getConfig().then(config => {
|
||||
if (!config.plugins) {
|
||||
console.error('web config is invalid, missing plugins:', config);
|
||||
}
|
||||
return config.plugins || DefaultConfig.plugins;
|
||||
}).catch(error => {
|
||||
console.log('cannot get web config:', error);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue