@@ -5,8 +5,7 @@ import AppWrapper from 'browser/components/AppWrapper'
55import renderWhenReady from 'browser/helpers/renderWhenReady'
66import React from 'react'
77
8- const completeStatus =
9- 'Update has been installed and will be applied on restart.'
8+ const completeStatus = 'Update Downloaded'
109
1110let 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