Skip to content

Commit d9fa02c

Browse files
committed
Fixing bug where QR code was never shown for Go job
1 parent 89cead7 commit d9fa02c

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/components/Go.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {getShortUUID, useProjectJobListener, useStartShipOnMount} from '@cli/uti
44
import {getJobBuildsRetry} from '@cli/api/index.js'
55

66
import {CommandContext, GameContext, JobProgress, QRCodeTerminal} from './index.js'
7+
import { Job, Platform } from '@cli/types/api.js'
78

89
interface 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

Comments
 (0)