Skip to content

Commit 19a57c5

Browse files
committed
save current Theme
1 parent fcbaade commit 19a57c5

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

src/pages/HomePage.jsx

+9-12
Original file line numberDiff line numberDiff line change
@@ -162,19 +162,16 @@ function HomePage({ focusKey: focusKeyParam }) {
162162
// Themes
163163
ipcChannel.sendMessage('get-available-themes');
164164
ipcChannel.once('get-available-themes', (systemsTemp) => {
165-
console.log({ systemsTemp });
166-
setState({ ...state, themes: systemsTemp });
165+
// Set current Selected theme
166+
const currentTheme = localStorage.getItem('current_theme');
167+
if (currentTheme) {
168+
ipcChannel.sendMessage('get-theme', [currentTheme]);
169+
ipcChannel.once('get-theme', (theme) => {
170+
setState({ ...state, themeName: currentTheme, themes: systemsTemp });
171+
setStateTheme({ ...stateTheme, theme });
172+
});
173+
}
167174
});
168-
169-
// Set current Selected theme.
170-
const currentTheme = localStorage.getItem('current_theme');
171-
if (currentTheme) {
172-
ipcChannel.sendMessage('get-theme', [currentTheme]);
173-
ipcChannel.once('get-theme', (theme) => {
174-
setState({ ...state, themeName: theme });
175-
setStateTheme({ ...stateTheme, theme });
176-
});
177-
}
178175
}, []);
179176

180177
const onClickSetTheme = (value) => {

0 commit comments

Comments
 (0)