mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-06 19:54:39 +00:00
refactor: reduce browser storage dependence, remove unused code
This commit is contained in:
@@ -1,13 +1,12 @@
|
||||
import browser from 'webextension-polyfill';
|
||||
import localforage from 'localforage';
|
||||
import { CustomTheme } from '../../../interface/types/CustomThemes';
|
||||
import { applyTheme } from './applyTheme';
|
||||
import { settingsState } from '../../utils/listeners/SettingsState';
|
||||
|
||||
|
||||
export const enableCurrentTheme = async () => {
|
||||
const { selectedTheme } = await browser.storage.local.get('selectedTheme') as { selectedTheme: string; };
|
||||
if (selectedTheme) {
|
||||
const theme = await localforage.getItem(selectedTheme) as CustomTheme;
|
||||
if (settingsState.selectedTheme) {
|
||||
const theme = await localforage.getItem(settingsState.selectedTheme) as CustomTheme;
|
||||
if (theme) {
|
||||
await applyTheme(theme);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user