Skip to content

Commit

Permalink
Check to ensure theme setting is preset before setting electron nativ…
Browse files Browse the repository at this point in the history
…e theme (#2890)

Fixes #2888

When setting the Electron nativeTheme with the theme selected in the Simplenote settings it can cause a JavaScript error if the theme setting isn't present, such as when logging out of the app.

This checks to ensure the theme setting is set before updating the Electron nativeTheme setting.
  • Loading branch information
sandymcfadden authored May 4, 2021
1 parent b3754d7 commit 97547db
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion desktop/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ module.exports = function main() {
Menu.setApplicationMenu(
Menu.buildFromTemplate(createMenuTemplate(args), mainWindow)
);
nativeTheme.themeSource = settings.theme;
if ('theme' in settings) {
nativeTheme.themeSource = settings.theme;
}
});

ipcMain.on('clearCookies', function () {
Expand Down

0 comments on commit 97547db

Please sign in to comment.