Skip to content

Commit

Permalink
fix: move update-native-theme into ipcRenderer useEffect (#1009)
Browse files Browse the repository at this point in the history
  • Loading branch information
setchy authored Apr 16, 2024
1 parent 421b9dd commit da2bf1c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/routes/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ export const SettingsRoute: FC = () => {
ipcRenderer.invoke('get-app-version').then((result: string) => {
setAppVersion(result);
});

ipcRenderer.on('update-native-theme', (_, updatedTheme: Theme) => {
if (settings.theme === Theme.SYSTEM) {
setTheme(updatedTheme);
}
});
}, []);

useMemo(() => {
Expand All @@ -77,12 +83,6 @@ export const SettingsRoute: FC = () => {
})();
}, [accounts.token]);

ipcRenderer.on('update-native-theme', (_, updatedTheme: Theme) => {
if (settings.theme === Theme.SYSTEM) {
setTheme(updatedTheme);
}
});

const logoutUser = useCallback(() => {
logout();
navigate(-1);
Expand Down

0 comments on commit da2bf1c

Please sign in to comment.