Skip to content

Commit

Permalink
refactor(app): tighten getAddressableAreaDisplayName iface
Browse files Browse the repository at this point in the history
  • Loading branch information
mjhuff committed Oct 25, 2024
1 parent 297f366 commit 760e728
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export function getMoveToAddressableAreaCommandText({
}: HandlesCommands<MoveToAddressableAreaRunTimeCommand>): string {
const addressableAreaDisplayName =
commandTextData != null
? getAddressableAreaDisplayName(commandTextData, command.id, t)
? getAddressableAreaDisplayName(commandTextData.commands, command.id, t)
: null

return t('move_to_addressable_area', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export function getMoveToAddressableAreaForDropTipCommandText({
}: HandlesCommands<MoveToAddressableAreaForDropTipRunTimeCommand>): string {
const addressableAreaDisplayName =
commandTextData != null
? getAddressableAreaDisplayName(commandTextData, command.id, t)
? getAddressableAreaDisplayName(commandTextData.commands, command.id, t)
: null

return t('move_to_addressable_area_drop_tip', {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
import type {
AddressableAreaName,
MoveToAddressableAreaParams,
RunTimeCommand,
} from '@opentrons/shared-data'
import type { TFunction } from 'i18next'

import type { CommandTextData } from '/app/local-resources/commands'

export function getAddressableAreaDisplayName(
commandTextData: CommandTextData,
commands: RunTimeCommand[] | undefined,
commandId: string,
t: TFunction
): string {
const addressableAreaCommand = (commandTextData?.commands ?? []).find(
const addressableAreaCommand = (commands ?? []).find(
command => command.id === commandId
)

Expand Down

0 comments on commit 760e728

Please sign in to comment.