Multi-second blank screen on second instance of the app (#5377)
* 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>
This commit is contained in:
@ -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, [
|
||||
@ -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
|
||||
|
Reference in New Issue
Block a user