@@ -4,6 +4,7 @@ import {getShortUUID, useProjectJobListener, useStartShipOnMount} from '@cli/uti
44import { getJobBuildsRetry } from '@cli/api/index.js'
55
66import { CommandContext , GameContext , JobProgress , QRCodeTerminal } from './index.js'
7+ import { Job , Platform } from '@cli/types/api.js'
78
89interface Props {
910 onComplete : ( ) => void
@@ -27,8 +28,8 @@ const GoCommand = ({command, gameId, onComplete, onError}: GoCommandProps): JSX.
2728
2829 const { jobs : startedJobs } = useStartShipOnMount ( command , flags , onError )
2930
30- const handleJobCompleted = async ( job : any ) => {
31- if ( job . id !== startedJobs ?. [ 0 ] . id ) return
31+ const handleJobCompleted = async ( job : Job ) => {
32+ if ( job . type != Platform . GO ) return
3233 const [ goBuild ] = await getJobBuildsRetry ( job . id , command . getGameId ( ) )
3334 setQRCodeData ( getShortUUID ( goBuild . id ) )
3435 const sleep = ( ms : number ) => new Promise ( ( resolve ) => setTimeout ( resolve , ms ) )
@@ -37,7 +38,7 @@ const GoCommand = ({command, gameId, onComplete, onError}: GoCommandProps): JSX.
3738 }
3839
3940 const handleJobFailed = ( job : any ) => {
40- if ( job . id !== startedJobs ?. [ 0 ] . id ) return
41+ if ( job . type != Platform . GO ) return
4142 onError ( new Error ( `Go job failed: ${ job . id } ` ) )
4243 }
4344
0 commit comments