We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
update-native-theme
useEffect
1 parent 421b9dd commit da2bf1cCopy full SHA for da2bf1c
src/routes/Settings.tsx
@@ -62,6 +62,12 @@ export const SettingsRoute: FC = () => {
62
ipcRenderer.invoke('get-app-version').then((result: string) => {
63
setAppVersion(result);
64
});
65
+
66
+ ipcRenderer.on('update-native-theme', (_, updatedTheme: Theme) => {
67
+ if (settings.theme === Theme.SYSTEM) {
68
+ setTheme(updatedTheme);
69
+ }
70
+ });
71
}, []);
72
73
useMemo(() => {
@@ -77,12 +83,6 @@ export const SettingsRoute: FC = () => {
77
83
})();
78
84
}, [accounts.token]);
79
85
80
- ipcRenderer.on('update-native-theme', (_, updatedTheme: Theme) => {
81
- if (settings.theme === Theme.SYSTEM) {
82
- setTheme(updatedTheme);
- }
- });
-
86
const logoutUser = useCallback(() => {
87
logout();
88
navigate(-1);
0 commit comments