@@ -201,7 +201,7 @@ export default class StartWorkspace extends React.Component<StartWorkspaceProps,
201
201
// Preparing means that we haven't actually started the workspace instance just yet, but rather
202
202
// are still preparing for launch. This means we're building the Docker image for the workspace.
203
203
case "preparing" :
204
- return < ImageBuildView workspaceId = { this . state . workspaceInstance . workspaceId } onStartWithDefaultImage = { e => { ( e . target as HTMLButtonElement ) . disabled = true ; this . startWorkspace ( true , true ) ; } } /> ;
204
+ return < ImageBuildView workspaceId = { this . state . workspaceInstance . workspaceId } /> ;
205
205
206
206
// Pending means the workspace does not yet consume resources in the cluster, but rather is looking for
207
207
// some space within the cluster. If for example the cluster needs to scale up to accomodate the
@@ -267,7 +267,11 @@ export default class StartWorkspace extends React.Component<StartWorkspaceProps,
267
267
case "stopped" :
268
268
phase = StartPhase . Stopped ;
269
269
if ( this . state . hasImageBuildLogs ) {
270
- return < ImageBuildView workspaceId = { this . state . workspaceInstance . workspaceId } onStartWithDefaultImage = { e => { ( e . target as HTMLButtonElement ) . disabled = true ; this . startWorkspace ( true , true ) ; } } phase = { phase } error = { error } /> ;
270
+ const restartWithDefaultImage = ( event : React . MouseEvent ) => {
271
+ ( event . target as HTMLButtonElement ) . disabled = true ;
272
+ this . startWorkspace ( true , true ) ;
273
+ }
274
+ return < ImageBuildView workspaceId = { this . state . workspaceInstance . workspaceId } onStartWithDefaultImage = { restartWithDefaultImage } phase = { phase } error = { error } /> ;
271
275
}
272
276
if ( ! isHeadless && this . state . workspaceInstance . status . conditions . timeout ) {
273
277
title = 'Timed Out' ;
@@ -297,7 +301,7 @@ export default class StartWorkspace extends React.Component<StartWorkspaceProps,
297
301
298
302
interface ImageBuildViewProps {
299
303
workspaceId : string ;
300
- onStartWithDefaultImage : ( event : React . MouseEvent ) => void ;
304
+ onStartWithDefaultImage ? : ( event : React . MouseEvent ) => void ;
301
305
phase ?: StartPhase ;
302
306
error ?: StartWorkspaceError ;
303
307
}
@@ -329,7 +333,7 @@ function ImageBuildView(props: ImageBuildViewProps) {
329
333
< Suspense fallback = { < div /> } >
330
334
< WorkspaceLogs logsEmitter = { logsEmitter } errorMessage = { props . error ?. message } />
331
335
</ Suspense >
332
- < button className = "mt-6 secondary" onClick = { props . onStartWithDefaultImage } > Continue with Default Image</ button >
336
+ { ! ! props . onStartWithDefaultImage && < button className = "mt-6 secondary" onClick = { props . onStartWithDefaultImage } > Continue with Default Image</ button > }
333
337
</ StartPage > ;
334
338
}
335
339
0 commit comments