🐛 Removed default empty stylesheet, Firefox warning

This commit is contained in:
Alicia Sykes 2022-05-06 12:44:29 +01:00
parent 7165a9a913
commit 6ec0bd20a1
2 changed files with 13 additions and 11 deletions

View File

@ -35,6 +35,7 @@ import {
} from '@/utils/ThemeHelper'; } from '@/utils/ThemeHelper';
import Defaults, { localStorageKeys } from '@/utils/defaults'; import Defaults, { localStorageKeys } from '@/utils/defaults';
import Keys from '@/utils/StoreMutations'; import Keys from '@/utils/StoreMutations';
import ErrorHandler from '@/utils/ErrorHandler';
import IconPalette from '@/assets/interface-icons/config-color-palette.svg'; import IconPalette from '@/assets/interface-icons/config-color-palette.svg';
export default { export default {
@ -86,19 +87,19 @@ export default {
/* Returns an array of links to external CSS from the Config */ /* Returns an array of links to external CSS from the Config */
externalThemes() { externalThemes() {
const availibleThemes = {}; const availibleThemes = {};
if (this.appConfig) { if (this.appConfig && this.appConfig.externalStyleSheet) {
if (this.appConfig.externalStyleSheet) { const externals = this.appConfig.externalStyleSheet;
const externals = this.appConfig.externalStyleSheet; if (Array.isArray(externals)) {
if (Array.isArray(externals)) { externals.forEach((ext, i) => {
externals.forEach((ext, i) => { availibleThemes[`External Stylesheet ${i + 1}`] = ext;
availibleThemes[`External Stylesheet ${i + 1}`] = ext; });
}); } else if (typeof externals === 'string') {
} else { availibleThemes['External Stylesheet'] = this.appConfig.externalStyleSheet;
availibleThemes['External Stylesheet'] = this.appConfig.externalStyleSheet; } else {
} ErrorHandler('External stylesheets must be of type string or string[]');
} }
} }
availibleThemes.Default = '#'; // availibleThemes.Default = '#';
return availibleThemes; return availibleThemes;
}, },
}, },

View File

@ -47,6 +47,7 @@ module.exports = {
}, },
/* List of built-in themes, to be displayed within the theme-switcher dropdown */ /* List of built-in themes, to be displayed within the theme-switcher dropdown */
builtInThemes: [ builtInThemes: [
'default',
'callisto', 'callisto',
'material', 'material',
'material-dark', 'material-dark',