mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-06 03:34:40 +00:00
fix: theme auto enabling attempting to reach unitialized variables
This commit is contained in:
+1
-1
@@ -59,12 +59,12 @@ async function init() {
|
|||||||
const icon = document.querySelector('link[rel*="icon"]')! as HTMLLinkElement
|
const icon = document.querySelector('link[rel*="icon"]')! as HTMLLinkElement
|
||||||
icon.href = icon48
|
icon.href = icon48
|
||||||
|
|
||||||
enableCurrentTheme()
|
|
||||||
try {
|
try {
|
||||||
// wait until settingsState has been loaded from storage
|
// wait until settingsState has been loaded from storage
|
||||||
await initializeSettingsState();
|
await initializeSettingsState();
|
||||||
|
|
||||||
if (settingsState.onoff) {
|
if (settingsState.onoff) {
|
||||||
|
enableCurrentTheme()
|
||||||
|
|
||||||
// TEMP FIX for bug! -> this is a hack to get the injected.css file to have HMR in development mode as this import system is currently broken with crxjs
|
// TEMP FIX for bug! -> this is a hack to get the injected.css file to have HMR in development mode as this import system is currently broken with crxjs
|
||||||
if (import.meta.env.MODE === 'development') {
|
if (import.meta.env.MODE === 'development') {
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import { settingsState } from '../../utils/listeners/SettingsState';
|
|||||||
|
|
||||||
|
|
||||||
export const enableCurrentTheme = async () => {
|
export const enableCurrentTheme = async () => {
|
||||||
|
console.log('enableCurrentTheme', settingsState.selectedTheme, await localforage.getItem(settingsState.selectedTheme));
|
||||||
if (settingsState.selectedTheme) {
|
if (settingsState.selectedTheme) {
|
||||||
const theme = await localforage.getItem(settingsState.selectedTheme) as CustomTheme;
|
const theme = await localforage.getItem(settingsState.selectedTheme) as CustomTheme;
|
||||||
if (theme) {
|
if (theme) {
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import browser from 'webextension-polyfill';
|
|
||||||
import localforage from 'localforage';
|
import localforage from 'localforage';
|
||||||
import { CustomTheme } from '../../../interface/types/CustomThemes';
|
import { CustomTheme } from '../../../interface/types/CustomThemes';
|
||||||
import { applyTheme } from './applyTheme';
|
import { applyTheme } from './applyTheme';
|
||||||
|
|||||||
Reference in New Issue
Block a user