Skip to content

Commit 21dff79

Browse files
authored
fix(app, shared-data): fix null check issue (#14619)
* fix(app, shared-data): fix null check issue
1 parent 1854842 commit 21dff79

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

__mocks__/electron-store.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// mock electron-store
22
'use strict'
33
import { vi } from 'vitest'
4-
// import { DEFAULTS_V12, migrate } from '../app-shell-odd/src/config/migrate'
54

65
// will by default mock the config dir. if you need other behaavior you can
76
// override this mock (see app-shell/src/__tests__/discovery.test.ts for an example)

app/src/resources/runs/useNotifyRunQuery.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export function useNotifyRunQuery<TError = Error>(
2424
useNotifyService({
2525
topic: `robot-server/runs/${runId}` as NotifyTopic,
2626
setRefetchUsingHTTP,
27-
options: { ...options, enabled: options.enabled && runId != null },
27+
options: { ...options, enabled: options.enabled != null && runId != null },
2828
})
2929

3030
const httpResponse = useRunQuery(runId, {

shared-data/js/helpers/getSimplestFlexDeckConfig.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,11 @@ export function getSimplestDeckConfigForProtocol(
8080
({ cutoutId }) => cutoutId === cutoutIdForAddressableArea
8181
)
8282
const previousRequiredAAs = acc[accIndex]?.requiredAddressableAreas
83-
const allNextRequiredAddressableAreas = previousRequiredAAs.includes(
84-
addressableArea
85-
)
86-
? previousRequiredAAs
87-
: [...previousRequiredAAs, addressableArea]
83+
const allNextRequiredAddressableAreas =
84+
previousRequiredAAs != null &&
85+
previousRequiredAAs.includes(addressableArea)
86+
? previousRequiredAAs
87+
: [...previousRequiredAAs, addressableArea]
8888
const nextCompatibleCutoutFixture = getSimplestFixtureForAddressableAreas(
8989
cutoutIdForAddressableArea,
9090
allNextRequiredAddressableAreas,

0 commit comments

Comments
 (0)