Skip to content

Commit 6a0ba89

Browse files
committed
get the rough edges on auto-update
1 parent 9314cdc commit 6a0ba89

File tree

3 files changed

+24
-25
lines changed

3 files changed

+24
-25
lines changed

packages/selenium-ide/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "selenium-ide",
3-
"version": "4.0.1-alpha.88",
3+
"version": "4.0.1-alpha.89",
44
"private": false,
55
"description": "Selenium IDE electron app",
66
"author": "Todd <tarsitodd@gmail.com>",
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { contextBridge, ipcRenderer } from "electron"
22

3-
function completeUpdateNotifier() {
4-
ipcRenderer.send('do-restart')
3+
function doRestart() {
4+
ipcRenderer.send('do-restart ')
55
}
66

7-
contextBridge.exposeInMainWorld('completeUpdateNotifier', completeUpdateNotifier);
7+
contextBridge.exposeInMainWorld('doRestart', doRestart);

packages/selenium-ide/src/browser/windows/UpdateNotifier/renderer.tsx

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ import AppWrapper from 'browser/components/AppWrapper'
55
import renderWhenReady from 'browser/helpers/renderWhenReady'
66
import React from 'react'
77

8-
const completeStatus =
9-
'Update has been installed and will be applied on restart.'
8+
const completeStatus = 'Update Downloaded'
109

1110
let lastStatus = ''
1211
// @ts-expect-error just whatever
@@ -22,36 +21,36 @@ const UpdateNotifier = () => {
2221
setStatus(lastStatus)
2322
}, [])
2423
// @ts-expect-error this exists
25-
const completeUpdateNotifier = () => window.completeUpdateNotifier()
26-
const closeUpdateNotifier = () => window.close()
24+
const doRestart = () => window.doRestart()
25+
const close = () => window.close()
2726

2827
return (
2928
<AppWrapper>
3029
<Grid className="centered pt-4" container spacing={1}>
3130
<Grid item xs={12}>
3231
<Typography variant="subtitle1">{status}</Typography>
3332
</Grid>
34-
{status === completeStatus && (
35-
<>
36-
<Grid item xs={6}>
37-
<Button onClick={closeUpdateNotifier} variant="outlined">
38-
OK
39-
</Button>
40-
</Grid>
41-
<Grid item xs={6}>
42-
<Button onClick={completeUpdateNotifier} variant="contained">
43-
Restart Now
44-
</Button>
45-
</Grid>
46-
</>
47-
)}
48-
{status.startsWith('Error') && (
33+
{status === completeStatus && (
34+
<>
35+
<Grid item xs={6}>
36+
<Button onClick={close} variant="outlined">
37+
OK
38+
</Button>
39+
</Grid>
40+
<Grid item xs={6}>
41+
<Button onClick={doRestart} variant="contained">
42+
Restart
43+
</Button>
44+
</Grid>
45+
</>
46+
)}
47+
{status.startsWith('Error') && (
4948
<Grid item xs={12}>
50-
<Button onClick={closeUpdateNotifier} variant="outlined">
49+
<Button onClick={close} variant="outlined">
5150
OK
5251
</Button>
5352
</Grid>
54-
)}
53+
)}
5554
</Grid>
5655
</AppWrapper>
5756
)

0 commit comments

Comments
 (0)