Skip to content

Commit

Permalink
Remove closed handler from electron remote window
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Mäder <[email protected]>
  • Loading branch information
tsmaeder committed Sep 21, 2022
1 parent 1b824eb commit d45c87b
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ export class ElectronSecondaryWindowService extends DefaultSecondaryWindowServic

protected override doCreateSecondaryWindow(id: string): Window | undefined {
electronRemote.getCurrentWindow().webContents.once('did-create-window', newElectronWindow => {
newElectronWindow.setMenuBarVisibility(false);
// newElectronWindow.setMenuBarVisibility(false);
this.electronWindows.set(id, newElectronWindow);
newElectronWindow.on('closed', () => {
const closedHandler = () => {
this.electronWindows.delete(id);
});
newElectronWindow.removeListener('closed', closedHandler);
};
newElectronWindow.on('closed', closedHandler);
});
return super.doCreateSecondaryWindow(id);
}
Expand Down

0 comments on commit d45c87b

Please sign in to comment.