Update ModalTerminal.tsx

This commit is contained in:
nguyentrungthat 2026-02-05 09:22:05 +07:00
parent c24febf32a
commit daddb7d812
1 changed files with 9 additions and 4 deletions

View File

@ -147,6 +147,7 @@ const ModalTerminal = ({
setDataTicket(INIT_TICKET);
setValueBaud("");
setActiveStep(0);
setActiveTabs("general");
}
}, [opened, line?.tickets]);
@ -605,7 +606,7 @@ const ModalTerminal = ({
active={activeStep}
onStepClick={(step) => {
if (!line) return;
if (step === 0) {
if (step === 0 && !isDisable) {
const dpelp = scenarios?.find(
(el) => el.title.toUpperCase() === "DPELP"
);
@ -633,7 +634,7 @@ const ModalTerminal = ({
setIsDisable(false);
}, 10000);
}
if (step === 1) {
if (step === 1 && !isDisable) {
setActiveTabs("physical");
socket?.emit("run_physical_test", {
lineId: line?.id,
@ -644,7 +645,7 @@ const ModalTerminal = ({
setIsDisable(false);
}, 15000);
}
if (step === 2 && !isDisable) {
if (activeStep === 2 && !isDisable) {
setIsDisable(true);
setTimeout(() => {
setIsDisable(false);
@ -669,7 +670,11 @@ const ModalTerminal = ({
<Stepper.Step
disabled={isDisable}
label="Completed"
description="Click to send report"
description={
activeStep !== 2
? "Complete all to send report"
: "Click to send report"
}
></Stepper.Step>
</Stepper>
<Flex></Flex>