Revert "add debouncing to selected theme"

This reverts commit ad7255efcc.
This commit is contained in:
SethBurkart123
2024-05-03 12:33:11 +10:00
parent ad7255efcc
commit be1679007e
3 changed files with 5 additions and 32 deletions
+1 -4
View File
@@ -25,17 +25,14 @@ export const ThemeCover: React.FC<ThemeCoverProps> = ({
const handleThemeClick = async () => {
if (isEditMode) return;
if (downloaded) {
// move the theme from temporary storage to SEQTAs storage
await sendThemeUpdate(theme as DownloadedTheme, true)
// remove from temp storage
await browser.runtime.sendMessage({
type: 'DeleteDownloadedTheme',
body: theme.id
})
// set it!
setTheme(theme.id);
} else {
console.debug(theme)
console.log(theme)
onThemeSelect(theme.id);
}
};
@@ -79,20 +79,10 @@ const ThemeSelector: ForwardRefExoticComponent<Omit<ThemeSelectorProps, "ref"> &
useEffect(() => {
fetchThemes();
/* const interval = setInterval(() => {
console.log("Done!");
if (isLoading == true) {
fetchThemes();
} else {
clearInterval(interval);
}
}, 1000); */
}, []);
const handleThemeSelect = useCallback(
async (themeId: string) => {
console.log(themeId === settingsState.selectedTheme);
if (themeId === settingsState.selectedTheme) {
await disableTheme();
setSelectedTheme('');