mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-06 03:34:40 +00:00
feat: add force theme option to custom themes
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { CustomImage, CustomTheme } from '../../../interface/types/CustomThemes';
|
||||
import { settingsState } from '../../utils/listeners/SettingsState';
|
||||
import { applyCustomCSS } from './Themes';
|
||||
|
||||
|
||||
@@ -8,6 +9,10 @@ export const applyTheme = async (theme: CustomTheme) => {
|
||||
|
||||
if (theme?.CustomCSS) CustomCSS = theme.CustomCSS;
|
||||
if (theme?.CustomImages) CustomImages = theme.CustomImages;
|
||||
if (theme?.forceDark) {
|
||||
settingsState.originalDarkMode = settingsState.DarkMode
|
||||
settingsState.DarkMode = theme.forceDark
|
||||
}
|
||||
|
||||
// Apply custom CSS
|
||||
applyCustomCSS(CustomCSS);
|
||||
|
||||
@@ -19,6 +19,11 @@ export const removeTheme = async (theme: CustomTheme) => {
|
||||
if (settingsState.originalSelectedColor !== '') {
|
||||
settingsState.selectedColor = settingsState.originalSelectedColor
|
||||
}
|
||||
|
||||
if (settingsState.originalDarkMode !== undefined) {
|
||||
settingsState.DarkMode = settingsState.originalDarkMode
|
||||
settingsState.originalDarkMode = undefined
|
||||
}
|
||||
|
||||
// Remove custom images
|
||||
const customImageVariables = theme.CustomImages.map((image) => image.variableName);
|
||||
|
||||
Reference in New Issue
Block a user