From 95b8dd6caee1accbfd57af5f9d5687ea49db0540 Mon Sep 17 00:00:00 2001 From: SethBurkart123 Date: Fri, 3 Nov 2023 11:08:51 +1100 Subject: [PATCH] fix theme removal setting theme --- src/seqta/ui/Themes.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/seqta/ui/Themes.js b/src/seqta/ui/Themes.js index 5f0266de..0518c663 100644 --- a/src/seqta/ui/Themes.js +++ b/src/seqta/ui/Themes.js @@ -92,10 +92,15 @@ export const downloadTheme = async (themeName, themeUrl) => { const themeData = await fetchThemeJSON(themeUrl); await saveToIndexedDB(themeData, themeName); console.log(`Theme ${themeName} saved to IndexedDB`); + await setTheme(themeName, themeUrl); }; export const deleteTheme = async (themeName) => { console.log(`Deleting theme ${themeName}...`); + const currentTheme = await localforage.getItem("selectedTheme"); + if (currentTheme === themeName) { + await disableTheme(); + } await localforage.removeItem(`css_${themeName}`); await Promise.all( (await localforage.keys()).filter((key) => key.startsWith(`images_${themeName}`)).map((key) => localforage.removeItem(key))