Skip to content

Commit

Permalink
Fix path comparison for electron exit confirmation
Browse files Browse the repository at this point in the history
  • Loading branch information
msujew committed Jan 5, 2022
1 parent 17b419f commit adcd054
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/core/src/electron-main/electron-main-application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,8 @@ export class ElectronMainApplication {

protected async handleStopRequest(electronWindow: BrowserWindow, onSafeCallback: () => unknown, reason: StopReason): Promise<void> {
// Only confirm close to windows that have loaded our front end.
const safeToClose = !electronWindow.webContents.getURL().includes(this.globals.THEIA_FRONTEND_HTML_PATH) || await this.checkSafeToStop(electronWindow, reason);
const frontendPath = this.globals.THEIA_FRONTEND_HTML_PATH.replace(/\\/g, '/');
const safeToClose = !electronWindow.webContents.getURL().includes(frontendPath) || await this.checkSafeToStop(electronWindow, reason);
if (safeToClose) {
onSafeCallback();
}
Expand Down

0 comments on commit adcd054

Please sign in to comment.