diff --git a/packages/selenium-ide/package.json b/packages/selenium-ide/package.json index 4e0ae0dde..46e00b375 100644 --- a/packages/selenium-ide/package.json +++ b/packages/selenium-ide/package.json @@ -1,6 +1,6 @@ { "name": "selenium-ide", - "version": "4.0.1-alpha.86", + "version": "4.0.1-alpha.87", "private": false, "description": "Selenium IDE electron app", "author": "Todd ", diff --git a/packages/selenium-ide/src/browser/windows/UpdateNotifier/controller.ts b/packages/selenium-ide/src/browser/windows/UpdateNotifier/controller.ts index 14ee85936..9f2fb0c94 100644 --- a/packages/selenium-ide/src/browser/windows/UpdateNotifier/controller.ts +++ b/packages/selenium-ide/src/browser/windows/UpdateNotifier/controller.ts @@ -1,8 +1,8 @@ import { WindowConfig } from 'browser/types' import Electron from 'electron' -const WIDTH = 400 -const HEIGHT = 150 +const WIDTH = 300 +const HEIGHT = 120 export const window: WindowConfig['window'] = () => { const display = Electron.screen.getPrimaryDisplay() @@ -15,12 +15,11 @@ export const window: WindowConfig['window'] = () => { minimizable: false, fullscreenable: false, autoHideMenuBar: true, + frame: false, maximizable: false, - show: false, skipTaskbar: true, useContentSize: false, - modal: true, - title: 'Update checker', + title: 'Checking for updates', webPreferences: { contextIsolation: true, nodeIntegration: false, diff --git a/packages/selenium-ide/src/browser/windows/UpdateNotifier/renderer.tsx b/packages/selenium-ide/src/browser/windows/UpdateNotifier/renderer.tsx index 022a24407..192357cac 100644 --- a/packages/selenium-ide/src/browser/windows/UpdateNotifier/renderer.tsx +++ b/packages/selenium-ide/src/browser/windows/UpdateNotifier/renderer.tsx @@ -5,13 +5,21 @@ import AppWrapper from 'browser/components/AppWrapper' import renderWhenReady from 'browser/helpers/renderWhenReady' import React from 'react' -const completeStatus = 'Update has been installed and will be applied on restart.' +const completeStatus = + 'Update has been installed and will be applied on restart.' + +let lastStatus = '' +// @ts-expect-error just whatever +window.setStatus = (status: string) => { + lastStatus = status +} const UpdateNotifier = () => { - const [status, setStatus] = React.useState('Checking for updates...') + const [status, setStatus] = React.useState(lastStatus) React.useEffect(() => { // @ts-expect-error just whatever window.setStatus = setStatus + setStatus(lastStatus) }, []) // @ts-expect-error this exists const completeUpdateNotifier = () => window.completeUpdateNotifier() @@ -23,9 +31,8 @@ const UpdateNotifier = () => { {status} - {status === completeStatus && ( - + <> - + )} {status.startsWith('Error') && ( - - + - )} + ) } diff --git a/packages/selenium-ide/src/main/session/controllers/System/index.ts b/packages/selenium-ide/src/main/session/controllers/System/index.ts index c66681ea7..db7073899 100644 --- a/packages/selenium-ide/src/main/session/controllers/System/index.ts +++ b/packages/selenium-ide/src/main/session/controllers/System/index.ts @@ -49,6 +49,7 @@ export default class SystemController extends BaseController { if (this.isDown) { // If automated, assume we already have a chromedriver process running if (!isAutomated) { + this.checkForUpdates() const startupError = await this.session.driver.startProcess( this.session.store.get('browserInfo') ) @@ -76,7 +77,6 @@ export default class SystemController extends BaseController { await this.session.api.system.onLog.addListener(this.writeToLog) this.isDown = false firstTime = false - this.checkForUpdates() } } @@ -118,7 +118,13 @@ export default class SystemController extends BaseController { ipcMain.once('do-restart', () => { autoUpdater.quitAndInstall() }) - autoUpdater.checkForUpdatesAndNotify() + const promise = await autoUpdater.checkForUpdatesAndNotify() + if (promise === null) { + window.webContents.executeJavaScript( + 'window.setStatus("No Update Available")' + ) + setTimeout(() => window.close(), 5000) + } } async shutdown() {