Skip to content

Commit

Permalink
Multi-second blank screen on second instance of the app (#5377)
Browse files Browse the repository at this point in the history
* Multi-second blank screen on second instance of the app
Fixes #5346

* Add !IS_PLAYWRIGHT

* A snapshot a day keeps the bugs away! πŸ“·πŸ› (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! πŸ“·πŸ› (OS: namespace-profile-ubuntu-8-cores)

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
pierremtb and github-actions[bot] authored Feb 15, 2025
1 parent 8dd2571 commit 6f3f5db
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ process.env.VITE_KC_CONNECTION_TIMEOUT_MS ??=
console.log('process.env', process.env)

/// Register our application to handle all "zoo-studio:" protocols.
const singleInstanceLock = app.requestSingleInstanceLock()
if (process.defaultApp) {
if (process.argv.length >= 2) {
app.setAsDefaultProtocolClient(ZOO_STUDIO_PROTOCOL, process.execPath, [
Expand All @@ -65,7 +66,13 @@ if (process.defaultApp) {

// Global app listeners
// Must be done before ready event.
registerStartupListeners()
// Checking against this lock is needed for Windows and Linux, see
// https://www.electronjs.org/docs/latest/tutorial/launch-app-from-url-in-another-app#windows-and-linux-code
if (!singleInstanceLock && !process.env.IS_PLAYWRIGHT) {
app.quit()
} else {
registerStartupListeners()
}

const createWindow = (pathToOpen?: string, reuse?: boolean): BrowserWindow => {
let newWindow
Expand Down

0 comments on commit 6f3f5db

Please sign in to comment.