Skip to content

Commit

Permalink
Fix key in mission form action list
Browse files Browse the repository at this point in the history
  • Loading branch information
ivangabriele committed Apr 8, 2024
1 parent 46525d8 commit 634bbdf
Showing 1 changed file with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export function ActionList({
onRemove,
onSelect
}: ActionListProps) {
const getMissionApiQuery = useGetMissionQuery(missionId || skipToken)
const getMissionApiQuery = useGetMissionQuery(missionId ?? skipToken)

const allSortedMissionActionsForTimeline: Array<
MissionActionForTimeline | EnvMissionAction.MissionActionForTimeline
Expand Down Expand Up @@ -118,13 +118,13 @@ export function ActionList({
if (action.source === Mission.MissionSource.MONITORFISH) {
return (
<ActionCard
// eslint-disable-next-line react/no-array-index-key
key={index}
isSelected={action.index === currentIndex}
missionAction={action}
onSelect={() => onSelect(action.index!!)}
>
<FishActionCard
// eslint-disable-next-line react/no-array-index-key
key={index}
missionAction={action as MissionActionFormValues}
onRemove={() => onRemove(action.index!!)}
/>
Expand All @@ -134,12 +134,13 @@ export function ActionList({

if (action.source === Mission.MissionSource.MONITORENV) {
return (
<ActionCard isSelected={false} missionAction={action}>
<EnvActionCard
// eslint-disable-next-line react/no-array-index-key
key={index}
missionAction={action as EnvMissionAction.MissionAction}
/>
<ActionCard
// eslint-disable-next-line react/no-array-index-key
key={index}
isSelected={false}
missionAction={action}
>
<EnvActionCard missionAction={action as EnvMissionAction.MissionAction} />
</ActionCard>
)
}
Expand Down

0 comments on commit 634bbdf

Please sign in to comment.