From 91aeebb07da47f59f95283a7aa47cbdc23b88070 Mon Sep 17 00:00:00 2001 From: Yisus Date: Mon, 9 Jan 2023 16:45:04 -0400 Subject: [PATCH] fix: set background window stayed open while main window was closed --- package.json | 2 +- src/config/app.json | 2 +- src/index.ts | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 7e7175e..5a67673 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "private": true, "name": "random-browser", "productName": "Random Browser", - "version": "1.2.0", + "version": "1.2.1", "description": "Just a random browser...", "main": "build/index.js", "scripts": { diff --git a/src/config/app.json b/src/config/app.json index 1ddb59c..2e1b855 100644 --- a/src/config/app.json +++ b/src/config/app.json @@ -1,3 +1,3 @@ { - "version": "v1.2.0" + "version": "v1.2.1" } \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 26ba19f..7173fc4 100644 --- a/src/index.ts +++ b/src/index.ts @@ -31,6 +31,11 @@ app.on('ready', () => { main.webContents.send('update-background', configs.background); }); + main.on('close', () => { + if (backgroundSelect != null) { + backgroundSelect.close() + } + }); }); function searchWindow(url: string) {