mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-05 19:24:39 +00:00
fix theme removal setting theme
This commit is contained in:
@@ -92,10 +92,15 @@ export const downloadTheme = async (themeName, themeUrl) => {
|
|||||||
const themeData = await fetchThemeJSON(themeUrl);
|
const themeData = await fetchThemeJSON(themeUrl);
|
||||||
await saveToIndexedDB(themeData, themeName);
|
await saveToIndexedDB(themeData, themeName);
|
||||||
console.log(`Theme ${themeName} saved to IndexedDB`);
|
console.log(`Theme ${themeName} saved to IndexedDB`);
|
||||||
|
await setTheme(themeName, themeUrl);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const deleteTheme = async (themeName) => {
|
export const deleteTheme = async (themeName) => {
|
||||||
console.log(`Deleting theme ${themeName}...`);
|
console.log(`Deleting theme ${themeName}...`);
|
||||||
|
const currentTheme = await localforage.getItem("selectedTheme");
|
||||||
|
if (currentTheme === themeName) {
|
||||||
|
await disableTheme();
|
||||||
|
}
|
||||||
await localforage.removeItem(`css_${themeName}`);
|
await localforage.removeItem(`css_${themeName}`);
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
(await localforage.keys()).filter((key) => key.startsWith(`images_${themeName}`)).map((key) => localforage.removeItem(key))
|
(await localforage.keys()).filter((key) => key.startsWith(`images_${themeName}`)).map((key) => localforage.removeItem(key))
|
||||||
|
|||||||
Reference in New Issue
Block a user