Skip to content

Commit 8c884c1

Browse files
committed
if no curr theme
1 parent 4d07de5 commit 8c884c1

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

src/renderer/App.tsx

+14-10
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,22 @@ export default function App() {
3838
ipcChannel.once('get-available-themes', (systemsTemp) => {
3939
// Set current Selected theme
4040
const currentTheme = localStorage.getItem('current_theme');
41+
let themeToCheck;
4142
if (currentTheme) {
42-
ipcChannel.sendMessage('get-theme', [currentTheme]);
43-
ipcChannel.once('get-theme', (theme) => {
44-
setState({
45-
...state,
46-
themeName: currentTheme,
47-
themes: systemsTemp,
48-
userfolder: userFolder,
49-
});
50-
setStateTheme({ ...stateTheme, theme });
51-
});
43+
themeToCheck = currentTheme;
44+
} else {
45+
themeToCheck = 'default';
5246
}
47+
ipcChannel.sendMessage('get-theme', [themeToCheck]);
48+
ipcChannel.once('get-theme', (theme) => {
49+
setState({
50+
...state,
51+
themeName: themeToCheck,
52+
themes: systemsTemp,
53+
userfolder: userFolder,
54+
});
55+
setStateTheme({ ...stateTheme, theme });
56+
});
5357
});
5458
});
5559
ipcChannel.sendMessage('get-theme', [themeName]);

0 commit comments

Comments
 (0)