Skip to content

Commit

Permalink
fix: Prevent errors by checking if the browser window is destroyed be…
Browse files Browse the repository at this point in the history
…fore hiding or closing.

This update adds checks to ensure that `hide()` and `close()` do not attempt actions on an already destroyed window, improving stability in window management.
  • Loading branch information
adkif committed Jan 2, 2025
1 parent 56e55bb commit e9b6025
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/desktop-core/src/lib/concretes/default-window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,19 @@ export class DefaultWindow implements IBaseWindow {

public hide(): void {
if (!this._browserWindow) return;

if (this._browserWindow.isDestroyed()) return;

this._browserWindow.hide();
}

public close(): void {
if (!this._browserWindow) return;

if (this._browserWindow.isDestroyed()) return;

this.hide();

this._browserWindow.destroy();
}

Expand Down

0 comments on commit e9b6025

Please sign in to comment.