From c61e61eff5b1e190a27f9615fdf4574f82ac3c05 Mon Sep 17 00:00:00 2001 From: Sarath M S Date: Wed, 17 Mar 2021 16:28:39 -0400 Subject: [PATCH] Fix how global.windows is updated upon window creation --- main/index.js | 5 +++-- main/windows/index.js | 5 +---- package.json | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/main/index.js b/main/index.js index 39aa9e51..831a6d72 100644 --- a/main/index.js +++ b/main/index.js @@ -47,8 +47,6 @@ autoUpdater.logger.transports.file.level = 'info' // To prevent garbage collection of the windows let windows = null -// Make the window instances accessible from everywhere -global.windows = windows app.allowRendererProcessReuse = true @@ -168,6 +166,9 @@ const createWindow = async (url) => { main: mainWindow(url) } + // Make the window instances accessible from everywhere + global.windows = windows + windows.main.once('ready-to-show', () => { toggleWindow(null, windows.main) }) diff --git a/main/windows/index.js b/main/windows/index.js index bf6384ff..9d0cffcd 100644 --- a/main/windows/index.js +++ b/main/windows/index.js @@ -1,5 +1,3 @@ -/* global require, module, process */ - const electron = require('electron') const { resolve } = require('app-root-path') @@ -9,7 +7,7 @@ const windowURL = require('./windowURL') const openAboutWindow = require('./aboutWindow') -const mainWindow = () => { +const mainWindow = (url = 'dashboard') => { let windowHeight = 640 if (isWinOS) { @@ -29,7 +27,6 @@ const mainWindow = () => { enableRemoteModule: true } }) - log.info('Loading main window.') win.loadURL(windowURL(url)) return win } diff --git a/package.json b/package.json index 80c14182..5f183451 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "description": "OONI Probe Desktop app", "author": "Open Observatory of Network Interference (OONI) ", "productName": "OONI Probe", - "version": "3.3.0-rc.1", + "version": "3.3.0-rc.2", "probeVersion": "3.8.0", "main": "main/index.js", "license": "BSD-3-Clause",