Skip to content

Commit 0742b22

Browse files
authored
fix: truth phase condition caused wrong message in module card (#2347)
1 parent 433081e commit 0742b22

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

workspaces/x2a/plugins/x2a/src/components/ModulePage/PhasesCard.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,19 +65,21 @@ const PhaseRunAction = ({
6565
}) => {
6666
const { t } = useTranslation();
6767

68+
const previousRunSucceeded = phase?.status === 'success';
69+
6870
const getInstructions = () => {
6971
if (phaseName === 'analyze') {
70-
return phase
72+
return previousRunSucceeded
7173
? t('modulePage.phases.reanalyzeInstructions')
7274
: t('modulePage.phases.analyzeInstructions');
7375
}
7476
if (phaseName === 'migrate') {
75-
return phase
77+
return previousRunSucceeded
7678
? t('modulePage.phases.remigrateInstructions')
7779
: t('modulePage.phases.migrateInstructions');
7880
}
7981
if (phaseName === 'publish') {
80-
return phase
82+
return previousRunSucceeded
8183
? t('modulePage.phases.republishInstructions')
8284
: t('modulePage.phases.publishInstructions');
8385
}
@@ -86,17 +88,17 @@ const PhaseRunAction = ({
8688

8789
const getActionText = () => {
8890
if (phaseName === 'analyze') {
89-
return phase
91+
return previousRunSucceeded
9092
? t('modulePage.phases.rerunAnalyze')
9193
: t('modulePage.phases.runAnalyze');
9294
}
9395
if (phaseName === 'migrate') {
94-
return phase
96+
return previousRunSucceeded
9597
? t('modulePage.phases.rerunMigrate')
9698
: t('modulePage.phases.runMigrate');
9799
}
98100
if (phaseName === 'publish') {
99-
return phase
101+
return previousRunSucceeded
100102
? t('modulePage.phases.rerunPublish')
101103
: t('modulePage.phases.runPublish');
102104
}

0 commit comments

Comments
 (0)