Skip to content

Commit 0e1bb1c

Browse files
committed
fix: add if check for triggering handlers for BuildInfraMetaInputFields
1 parent e69c36e commit 0e1bb1c

File tree

2 files changed

+17
-10
lines changed

2 files changed

+17
-10
lines changed

src/Pages/GlobalConfigurations/BuildInfra/BuildInfraDescriptionField.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,16 @@ const BuildInfraProfileDescriptionField: FunctionComponent<BuildInfraProfileMeta
2626
error,
2727
}) => {
2828
const handleChange = (e: FormEvent<HTMLTextAreaElement>) => {
29-
handleProfileInputChange?.({
30-
action: BuildInfraMetaConfigTypes.DESCRIPTION,
31-
data: { value: e.currentTarget.value },
32-
})
29+
if (handleProfileInputChange) {
30+
handleProfileInputChange({
31+
action: BuildInfraMetaConfigTypes.DESCRIPTION,
32+
data: { value: e.currentTarget.value },
33+
})
3334

34-
onChange?.(e)
35+
return
36+
}
37+
38+
onChange(e)
3539
}
3640

3741
return (

src/Pages/GlobalConfigurations/BuildInfra/BuildInfraProfileNameField.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,15 @@ const BuildInfraProfileNameField: FunctionComponent<BuildInfraProfileMetaFieldPr
2626
error,
2727
}) => {
2828
const handleChange = (e: FormEvent<HTMLInputElement>) => {
29-
handleProfileInputChange?.({
30-
action: BuildInfraMetaConfigTypes.NAME,
31-
data: { value: e.currentTarget.value },
32-
})
29+
if (handleProfileInputChange) {
30+
handleProfileInputChange({
31+
action: BuildInfraMetaConfigTypes.NAME,
32+
data: { value: e.currentTarget.value },
33+
})
34+
return
35+
}
3336

34-
onChange?.(e)
37+
onChange(e)
3538
}
3639

3740
return (

0 commit comments

Comments
 (0)