fixed issues with selected type conflicting

This commit is contained in:
SethBurkart123
2023-11-02 19:12:05 +11:00
parent e332977e08
commit 1d58334e4e
+6 -2
View File
@@ -66,8 +66,6 @@ const ThemeSelector = ({ selectedType, setSelectedType, isEditMode }: ThemeSelec
return; return;
} }
console.log("Theme: ", theme);
// If theme is downloaded and is the currently enabled theme, disable it. // If theme is downloaded and is the currently enabled theme, disable it.
if (theme.isDownloaded && themeName === enabledThemeName) { if (theme.isDownloaded && themeName === enabledThemeName) {
await disableTheme(); await disableTheme();
@@ -97,6 +95,12 @@ const ThemeSelector = ({ selectedType, setSelectedType, isEditMode }: ThemeSelec
stopLoading(themeName); stopLoading(themeName);
}; };
useEffect(() => {
if (selectedType === 'background') {
setEnabledThemeName('');
}
}, [selectedType]);
return ( return (
<div className="my-2"> <div className="my-2">
<h2 className="pb-2 text-lg font-bold">Themes</h2> <h2 className="pb-2 text-lg font-bold">Themes</h2>