From 0b1966a9e0d8c1785e21c6f2dbaa526f924bfcb5 Mon Sep 17 00:00:00 2001 From: Rohit Date: Thu, 30 Jan 2025 23:27:16 +0530 Subject: [PATCH] feat: globally set robot state --- src/components/robot/RobotDuplicate.tsx | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/components/robot/RobotDuplicate.tsx b/src/components/robot/RobotDuplicate.tsx index efde9b2a..4e0ef887 100644 --- a/src/components/robot/RobotDuplicate.tsx +++ b/src/components/robot/RobotDuplicate.tsx @@ -55,9 +55,8 @@ interface RobotSettingsProps { export const RobotDuplicationModal = ({ isOpen, handleStart, handleClose, initialSettings }: RobotSettingsProps) => { const { t } = useTranslation(); - const [robot, setRobot] = useState(null); const [targetUrl, setTargetUrl] = useState(''); - const { recordingId, notify } = useGlobalInfoStore(); + const { recordingId, notify, robot, setRobot } = useGlobalInfoStore(); useEffect(() => { if (isOpen) { @@ -99,10 +98,6 @@ export const RobotDuplicationModal = ({ isOpen, handleStart, handleClose, initia notify('success', t('robot_duplication.notifications.duplicate_success')); handleStart(robot); handleClose(); - - setTimeout(() => { - window.location.reload(); - }, 1000); } else { notify('error', t('robot_duplication.notifications.duplicate_error')); }