Skip to content

Commit

Permalink
front: fix stdcm simulation loader popping if time is invalid
Browse files Browse the repository at this point in the history
The simulation now becomes pending only if all fields are valid.

Signed-off-by: SharglutDev <p.filimon75@gmail.com>
  • Loading branch information
SharglutDev committed Jan 9, 2025
1 parent b9329c4 commit dd492f0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion front/src/applications/stdcm/hooks/useStdcm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,12 @@ const useStdcm = ({
};

const launchStdcmRequest = async () => {
setCurrentStdcmRequestStatus(STDCM_REQUEST_STATUS.pending);
setStdcmResponse(undefined);
setStdcmTrainConflicts(undefined);

const validConfig = checkStdcmConf(dispatch, t, osrdconf);
if (validConfig) {
setCurrentStdcmRequestStatus(STDCM_REQUEST_STATUS.pending);
const payload = formatStdcmPayload(validConfig);
try {
const promise = postTimetableByIdStdcm(payload);
Expand Down

0 comments on commit dd492f0

Please sign in to comment.