Skip to content

Commit

Permalink
fix linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
joeizang committed Dec 21, 2021
1 parent 80ecab3 commit 6ec5c4c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion apps/remix-ide/src/app/tabs/theme-module.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 3 additions & 5 deletions libs/remix-ui/theme-module/src/lib/remix-ui-theme-module.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,11 @@ const defaultThemes = [
];

export function RemixUiThemeModule({ themeModule }: RemixUiThemeModuleProps) {
const [themeName, setThemeName] = useState('');
const [themes, _] = useState<Theme[]>(defaultThemes);
const themeRef = useRef<any>(null);
const [themeName, setThemeName] = useState('')

useEffect(() => {
themeModule.switchTheme()
}, [themeName, themeModule]);
}, [themeName, themeModule])

return (
<div className="border-top">
Expand Down Expand Up @@ -102,7 +100,7 @@ export function RemixUiThemeModule({ themeModule }: RemixUiThemeModuleProps) {
</div>
</div>
</div>
);
)
}

export default RemixUiThemeModule;

0 comments on commit 6ec5c4c

Please sign in to comment.