Skip to content

Commit cdf7143

Browse files
committed
chore: remove referPrevState from getMandatoryPluginData
1 parent 7b9428f commit cdf7143

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/components/CIPipelineN/CIPipeline.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ export default function CIPipeline({
366366
}
367367
setPresetPlugins(_presetPlugin)
368368
setSharedPlugins(_sharedPlugin)
369-
getMandatoryPluginData(_formData, [..._presetPlugin, ..._sharedPlugin], true)
369+
getMandatoryPluginData(_formData, [..._presetPlugin, ..._sharedPlugin])
370370
})
371371
.catch((error: ServerErrors) => {
372372
showError(error)
@@ -385,7 +385,6 @@ export default function CIPipeline({
385385
const getMandatoryPluginData = (
386386
_formData: PipelineFormType,
387387
pluginList: PluginDetailType[],
388-
referPrevState: boolean = false,
389388
): void => {
390389
if (!isJobCard && processPluginData && prepareFormData && pluginList.length) {
391390
let branchName = ''
@@ -401,11 +400,7 @@ export default function CIPipeline({
401400
processPluginData(_formData, pluginList, appId, ciPipelineId, branchName)
402401
.then((response: MandatoryPluginDataType) => {
403402
setMandatoryPluginData(response)
404-
if (referPrevState) {
405-
setFormData((prevForm) => prepareFormData({ ...prevForm }, response?.pluginData ?? []))
406-
} else {
407-
setFormData(prepareFormData(_formData, response?.pluginData ?? []))
408-
}
403+
setFormData((prevForm) => prepareFormData({ ...prevForm }, response?.pluginData ?? []))
409404
})
410405
.catch((error: ServerErrors) => {
411406
showError(error)

0 commit comments

Comments
 (0)