Skip to content

Commit

Permalink
fix(app, shared-data): fix null check issue (#14619)
Browse files Browse the repository at this point in the history
* fix(app, shared-data): fix null check issue
  • Loading branch information
koji authored Mar 11, 2024
1 parent 1854842 commit 21dff79
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
1 change: 0 additions & 1 deletion __mocks__/electron-store.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// mock electron-store
'use strict'
import { vi } from 'vitest'
// import { DEFAULTS_V12, migrate } from '../app-shell-odd/src/config/migrate'

// will by default mock the config dir. if you need other behaavior you can
// override this mock (see app-shell/src/__tests__/discovery.test.ts for an example)
Expand Down
2 changes: 1 addition & 1 deletion app/src/resources/runs/useNotifyRunQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function useNotifyRunQuery<TError = Error>(
useNotifyService({
topic: `robot-server/runs/${runId}` as NotifyTopic,
setRefetchUsingHTTP,
options: { ...options, enabled: options.enabled && runId != null },
options: { ...options, enabled: options.enabled != null && runId != null },
})

const httpResponse = useRunQuery(runId, {
Expand Down
10 changes: 5 additions & 5 deletions shared-data/js/helpers/getSimplestFlexDeckConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ export function getSimplestDeckConfigForProtocol(
({ cutoutId }) => cutoutId === cutoutIdForAddressableArea
)
const previousRequiredAAs = acc[accIndex]?.requiredAddressableAreas
const allNextRequiredAddressableAreas = previousRequiredAAs.includes(
addressableArea
)
? previousRequiredAAs
: [...previousRequiredAAs, addressableArea]
const allNextRequiredAddressableAreas =
previousRequiredAAs != null &&
previousRequiredAAs.includes(addressableArea)
? previousRequiredAAs
: [...previousRequiredAAs, addressableArea]
const nextCompatibleCutoutFixture = getSimplestFixtureForAddressableAreas(
cutoutIdForAddressableArea,
allNextRequiredAddressableAreas,
Expand Down

0 comments on commit 21dff79

Please sign in to comment.