improve theme creator styling

This commit is contained in:
SethBurkart123
2024-04-01 21:25:06 +11:00
parent f9ddd38ff8
commit 48a6b186dd
3 changed files with 13 additions and 10 deletions
+5 -1
View File
@@ -16,13 +16,17 @@ export const enableCurrentTheme = async () => {
export const deleteTheme = async (themeId: string) => {
try {
const theme = await localforage.getItem(themeId) as CustomTheme;
removeTheme(theme);
await localforage.removeItem(themeId);
const themeIds = await localforage.getItem('customThemes') as string[] | null;
if (themeIds) {
const updatedThemeIds = themeIds.filter((id) => id !== themeId);
await localforage.setItem('customThemes', updatedThemeIds);
}
console.log('Theme deleted successfully!');
await browser.storage.local.set({ selectedTheme: '' });
} catch (error) {
console.error('Error deleting theme:', error);
}