From 5840731a31794800116d6213b87253b24a053fa5 Mon Sep 17 00:00:00 2001 From: Ivan Gabriele Date: Tue, 16 Jan 2024 18:44:55 +0100 Subject: [PATCH] Refactor SonarCloud suggestions --- frontend/src/features/Mission/useCases/addMission.ts | 4 ++-- frontend/src/features/SideWindow/MissionForm/index.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/features/Mission/useCases/addMission.ts b/frontend/src/features/Mission/useCases/addMission.ts index cd7e94222d..e45bd815c5 100644 --- a/frontend/src/features/Mission/useCases/addMission.ts +++ b/frontend/src/features/Mission/useCases/addMission.ts @@ -12,12 +12,12 @@ export const addMission = }): MainAppThunk => dispatch => { const mainFormValues = - initialValues?.mainFormValues || getMissionFormInitialValues(undefined, []).initialMainFormValues + initialValues?.mainFormValues ?? getMissionFormInitialValues(undefined, []).initialMainFormValues dispatch( sideWindowDispatchers.openPath({ initialData: { - actionsFormValues: initialValues?.actionsFormValues || [], + actionsFormValues: initialValues?.actionsFormValues ?? [], mainFormValues }, menu: SideWindowMenuKey.MISSION_FORM diff --git a/frontend/src/features/SideWindow/MissionForm/index.tsx b/frontend/src/features/SideWindow/MissionForm/index.tsx index b3c737868d..a8f1a3023c 100644 --- a/frontend/src/features/SideWindow/MissionForm/index.tsx +++ b/frontend/src/features/SideWindow/MissionForm/index.tsx @@ -537,7 +537,7 @@ export function MissionForm() { const { initialActionsFormValues, initialMainFormValues } = getMissionFormInitialValues( mission, - missionWithActions?.actions || [] + missionWithActions?.actions ?? [] ) const [, { nextActionsFormValues, nextMainFormValues }] = validateMissionForms( initialMainFormValues,