Fix TypeError: Cannot read property 'isVisible' of undefined

Between v1.32.1 and v1.32.2, createMainWindow() was made an
async function, so createTrayIcon() and setupMenu() were called too early.

await createMainWindow() before adding the tray icon and menu.

Co-authored-by: Matthias Andree <matthias.andree@gmx.de>
This commit is contained in:
Ken Powers 2020-03-26 15:24:40 -04:00 committed by GitHub
parent 9c3196a90c
commit 090541bdb8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -914,8 +914,7 @@ app.on('ready', async () => {
ready = true;
createWindow();
await createWindow();
if (usingTrayIcon) {
tray = createTrayIcon(getMainWindow, locale.messages);
}