diff --git a/apps/remix-ide/src/app/tabs/theme-module.js b/apps/remix-ide/src/app/tabs/theme-module.js index a5cea0d2ff..5524199f1a 100644 --- a/apps/remix-ide/src/app/tabs/theme-module.js +++ b/apps/remix-ide/src/app/tabs/theme-module.js @@ -105,7 +105,7 @@ export class ThemeModule extends Plugin { throw new Error(`Theme ${themeName} doesn't exist`) } const next = themeName || this.active // Name - if (next === this.active) return + if (next === this.active) return // --> exit out of this method _paq.push(['trackEvent', 'themeModule', 'switchTo', next]) const nextTheme = this.themes[next] // Theme if (!this.forced) this._deps.config.set('settings/theme', next) diff --git a/libs/remix-ui/theme-module/src/lib/remix-ui-theme-module.tsx b/libs/remix-ui/theme-module/src/lib/remix-ui-theme-module.tsx index c960827735..92002f3a66 100644 --- a/libs/remix-ui/theme-module/src/lib/remix-ui-theme-module.tsx +++ b/libs/remix-ui/theme-module/src/lib/remix-ui-theme-module.tsx @@ -58,13 +58,11 @@ const defaultThemes = [ ]; export function RemixUiThemeModule({ themeModule }: RemixUiThemeModuleProps) { - const [themeName, setThemeName] = useState(''); - const [themes, _] = useState(defaultThemes); - const themeRef = useRef(null); + const [themeName, setThemeName] = useState('') useEffect(() => { themeModule.switchTheme() - }, [themeName, themeModule]); + }, [themeName, themeModule]) return (
@@ -102,7 +100,7 @@ export function RemixUiThemeModule({ themeModule }: RemixUiThemeModuleProps) {
- ); + ) } export default RemixUiThemeModule;