Fix error on quit when trying to message closed window
This commit is contained in:
parent
38193e6591
commit
d996c2f950
1 changed files with 3 additions and 0 deletions
3
main.js
3
main.js
|
@ -386,6 +386,9 @@ async function createWindow() {
|
|||
mainWindow.on('move', debouncedCaptureStats);
|
||||
|
||||
const setWindowFocus = () => {
|
||||
if (!mainWindow) {
|
||||
return;
|
||||
}
|
||||
mainWindow.webContents.send('set-window-focus', mainWindow.isFocused());
|
||||
};
|
||||
mainWindow.on('focus', setWindowFocus);
|
||||
|
|
Loading…
Add table
Reference in a new issue