Skip to content

Commit

Permalink
Merge pull request #62 from tonkeeper/feature/open-after-close
Browse files Browse the repository at this point in the history
Fix application open after close
  • Loading branch information
KuznetsovNikita authored Apr 1, 2024
2 parents 840e6e6 + f7fd661 commit b785641
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/desktop/src/electron/mainWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export abstract class MainWindow {
static mainWindow: BrowserWindow | undefined = undefined;

static async openMainWindow() {
if (this.mainWindow !== undefined) return this.mainWindow;
if (this.mainWindow !== undefined && this.mainWindow !== null) return this.mainWindow;

const icon = (() => {
switch (process.platform) {
Expand Down Expand Up @@ -58,7 +58,7 @@ export abstract class MainWindow {

this.mainWindow.on('closed', () => {
ipcMain.removeHandler('message');
this.mainWindow = null;
this.mainWindow = undefined;
});

ipcMain.handle('message', async (event, message: Message) => {
Expand Down

0 comments on commit b785641

Please sign in to comment.