mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-06 03:34:40 +00:00
save selected color when enabling themes
This commit is contained in:
@@ -12,15 +12,20 @@ export const setTheme = async (themeId: string) => {
|
|||||||
|
|
||||||
console.debug('Loading theme', theme);
|
console.debug('Loading theme', theme);
|
||||||
|
|
||||||
|
let originalSelectedColor = { selectedColor: '' };
|
||||||
|
|
||||||
// Remove the currently enabled theme
|
// Remove the currently enabled theme
|
||||||
if (enabledTheme.selectedTheme) {
|
if (enabledTheme.selectedTheme) {
|
||||||
const currentTheme = await localforage.getItem(enabledTheme.selectedTheme) as CustomTheme;
|
const currentTheme = await localforage.getItem(enabledTheme.selectedTheme) as CustomTheme;
|
||||||
if (currentTheme) {
|
if (currentTheme) {
|
||||||
removeTheme(currentTheme);
|
removeTheme(currentTheme);
|
||||||
}
|
}
|
||||||
|
const color = await browser.storage.local.get('originalSelectedColor') as { originalSelectedColor: string; };
|
||||||
|
originalSelectedColor = { selectedColor: color.originalSelectedColor };
|
||||||
|
} else {
|
||||||
|
originalSelectedColor = await browser.storage.local.get('selectedColor') as { selectedColor: string; };
|
||||||
}
|
}
|
||||||
|
|
||||||
const originalSelectedColor = await browser.storage.local.get('selectedColor') as { selectedColor: string; };
|
|
||||||
await applyTheme(theme);
|
await applyTheme(theme);
|
||||||
|
|
||||||
await browser.storage.local.set({
|
await browser.storage.local.set({
|
||||||
|
|||||||
Reference in New Issue
Block a user