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

Merge remote-tracking branch 'origin/master' into standalone

Conflicts:
	package.json
	src/components/appRouter.js
	src/components/require/requiretext.js
	src/config.json
	src/scripts/clientUtils.js
	src/scripts/settings/webSettings.js
	src/scripts/site.js
This commit is contained in:
Dmitry Lyzo 2020-11-21 21:03:18 +03:00
commit 5592cb7d4e
310 changed files with 7707 additions and 6701 deletions

View file

@ -94,15 +94,41 @@ export function getServers() {
});
}
const baseDefaultTheme = {
'name': 'Dark',
'id': 'dark',
'default': true
};
let internalDefaultTheme = baseDefaultTheme;
const checkDefaultTheme = (themes) => {
if (themes) {
const defaultTheme = themes.find((theme) => theme.default);
if (defaultTheme) {
internalDefaultTheme = defaultTheme;
return;
}
}
internalDefaultTheme = baseDefaultTheme;
};
export function getThemes() {
return getConfig().then(config => {
return config.themes;
const themes = Array.isArray(config.themes) ? config.themes : [];
checkDefaultTheme(themes);
return themes;
}).catch(error => {
console.log('cannot get web config:', error);
checkDefaultTheme();
return [];
});
}
export const getDefaultTheme = () => internalDefaultTheme;
export function getPlugins() {
return getConfig().then(config => {
return config.plugins;
@ -111,12 +137,3 @@ export function getPlugins() {
return [];
});
}
export function getFonts() {
return getConfig().then(config => {
return config.fonts;
}).catch(error => {
console.log('cannot get web config:', error);
return [];
});
}