mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-06 03:34:40 +00:00
improve theme selection + bug fixes
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import browser from 'webextension-polyfill';
|
||||
import { CustomImage, CustomTheme } from '../../../interface/types/CustomThemes';
|
||||
import { applyCustomCSS } from './Themes';
|
||||
|
||||
@@ -6,20 +5,13 @@ import { applyCustomCSS } from './Themes';
|
||||
export const applyTheme = async (theme: CustomTheme) => {
|
||||
let CustomCSS = '';
|
||||
let CustomImages: CustomImage[] = [];
|
||||
let defaultColour = '';
|
||||
|
||||
if (theme?.CustomCSS) CustomCSS = theme.CustomCSS;
|
||||
if (theme?.CustomImages) CustomImages = theme.CustomImages;
|
||||
if (theme?.defaultColour) defaultColour = theme.defaultColour;
|
||||
|
||||
// Apply custom CSS
|
||||
applyCustomCSS(CustomCSS);
|
||||
|
||||
// Apply default color
|
||||
if (defaultColour !== '') {
|
||||
browser.storage.local.set({ selectedColor: defaultColour });
|
||||
}
|
||||
|
||||
// Apply custom images
|
||||
CustomImages.forEach((image) => {
|
||||
const imageUrl = URL.createObjectURL(image.blob);
|
||||
|
||||
Reference in New Issue
Block a user