Skip to content

Commit

Permalink
Adjusted use of hook
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenthoms committed Aug 22, 2023
1 parent 6e79e7d commit fb62f5a
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const SelectEnsemblesDialog: React.FC<SelectEnsemblesDialogProps> = (prop

const [selectedField, setSelectedField] = useValidState<string>(
"",
fieldsQuery.data ? fieldsQuery.data.map((item) => item.field_identifier) : [],
[fieldsQuery.data ?? [], (item) => item.field_identifier],
true
);

Expand All @@ -66,7 +66,7 @@ export const SelectEnsemblesDialog: React.FC<SelectEnsemblesDialogProps> = (prop

const [selectedCaseId, setSelectedCaseId] = useValidState<string>(
"",
casesQuery.data ? casesQuery.data.map((item) => item.uuid) : [],
[casesQuery.data ?? [], (item) => item.uuid],
true
);

Expand All @@ -85,7 +85,7 @@ export const SelectEnsemblesDialog: React.FC<SelectEnsemblesDialogProps> = (prop

const [selectedEnsembleName, setSelectedEnsembleName] = useValidState<string>(
"",
ensemblesQuery.data ? ensemblesQuery.data.map((item) => item.name) : [],
[ensemblesQuery.data ?? [], (el) => el.name],
true
);

Expand Down

0 comments on commit fb62f5a

Please sign in to comment.