Skip to content

Commit

Permalink
Fix how global.windows is updated upon window creation
Browse files Browse the repository at this point in the history
  • Loading branch information
sarathms committed Mar 17, 2021
1 parent c9369d8 commit c61e61e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
5 changes: 3 additions & 2 deletions main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
})
Expand Down
5 changes: 1 addition & 4 deletions main/windows/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* global require, module, process */

const electron = require('electron')
const { resolve } = require('app-root-path')

Expand All @@ -9,7 +7,7 @@ const windowURL = require('./windowURL')

const openAboutWindow = require('./aboutWindow')

const mainWindow = () => {
const mainWindow = (url = 'dashboard') => {
let windowHeight = 640

if (isWinOS) {
Expand All @@ -29,7 +27,6 @@ const mainWindow = () => {
enableRemoteModule: true
}
})
log.info('Loading main window.')
win.loadURL(windowURL(url))
return win
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "OONI Probe Desktop app",
"author": "Open Observatory of Network Interference (OONI) <[email protected]>",
"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",
Expand Down

0 comments on commit c61e61e

Please sign in to comment.