@@ -328,7 +328,7 @@ class Workspace extends React.Component {
328
328
path : `${ workspaceTerminateUrl } ` ,
329
329
method : 'POST' ,
330
330
} ) . then ( ( ) => {
331
- this . checkWorkspaceStatus ( ) ;
331
+ this . checkWorkspaceStatus ( { triggerPayModelCall : true } ) ;
332
332
} ) ;
333
333
} ) ;
334
334
}
@@ -360,7 +360,7 @@ class Workspace extends React.Component {
360
360
}
361
361
}
362
362
363
- checkWorkspaceStatus = async ( ) => {
363
+ checkWorkspaceStatus = async ( args ) => {
364
364
if ( this . state . interval ) {
365
365
clearInterval ( this . state . interval ) ;
366
366
}
@@ -370,6 +370,13 @@ class Workspace extends React.Component {
370
370
if ( this . workspaceStates . includes ( data . status ) ) {
371
371
const workspaceLaunchStepsConfig = this . getWorkspaceLaunchSteps ( data ) ;
372
372
let workspaceStatus = data . status ;
373
+ if ( args ?. triggerPayModelCall && workspaceStatus === 'Not Found' ) {
374
+ this . getWorkspacePayModel ( ) . then ( ( payModelData ) => {
375
+ this . setState ( {
376
+ payModel : payModelData ,
377
+ } ) ;
378
+ } ) ;
379
+ }
373
380
if ( workspaceLaunchStepsConfig && workspaceLaunchStepsConfig . currentStepsStatus === 'error' ) {
374
381
workspaceStatus = 'Stopped' ;
375
382
}
@@ -510,7 +517,7 @@ class Workspace extends React.Component {
510
517
const showExternalLoginsHintBanner = this . state . externalLoginOptions . length > 0
511
518
&& this . state . externalLoginOptions . some ( ( option ) => ! option . refresh_token_expiration ) ;
512
519
const isPayModelAboveLimit = this . state . payModel . current_pay_model ?. request_status === 'above limit' ;
513
- const isPaymodelNeededToLaunch = this . state . payModel . length > 0 && this . state . payModel . current_pay_model == null ;
520
+ const isPaymodelNeededToLaunch = Object . keys ( this . state . payModel ) . length > 0 && this . state . payModel . current_pay_model == null ;
514
521
return (
515
522
< div
516
523
className = { `workspace ${ this . state . workspaceIsFullpage ? 'workspace--fullpage' : '' } ` }
0 commit comments