From 8a1c0db89d4c8acb8569ddb4a56f44e609121eb5 Mon Sep 17 00:00:00 2001 From: Rohit Date: Sat, 1 Feb 2025 11:30:35 +0530 Subject: [PATCH] feat: set rerender true on edit --- src/components/robot/RobotEdit.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/components/robot/RobotEdit.tsx b/src/components/robot/RobotEdit.tsx index 05c4b847..89b6e701 100644 --- a/src/components/robot/RobotEdit.tsx +++ b/src/components/robot/RobotEdit.tsx @@ -77,7 +77,7 @@ interface GroupedCredentials { export const RobotEditModal = ({ isOpen, handleStart, handleClose, initialSettings }: RobotSettingsProps) => { const { t } = useTranslation(); const [credentials, setCredentials] = useState({}); - const { recordingId, notify, robot, setRobot } = useGlobalInfoStore(); + const { recordingId, notify, robot, setRobot, setRerenderRobots } = useGlobalInfoStore(); const [credentialGroups, setCredentialGroups] = useState({ passwords: [], emails: [], @@ -85,7 +85,6 @@ export const RobotEditModal = ({ isOpen, handleStart, handleClose, initialSettin others: [] }); const [showPasswords, setShowPasswords] = useState({}); - const navigate = useNavigate(); const isEmailPattern = (value: string): boolean => { return value.includes('@'); @@ -367,11 +366,11 @@ export const RobotEditModal = ({ isOpen, handleStart, handleClose, initialSettin const success = await updateRecording(robot.recording_meta.id, payload); if (success) { + setRerenderRobots(true); + notify('success', t('robot_edit.notifications.update_success')); handleStart(robot); handleClose(); - - navigate('/robots'); } else { notify('error', t('robot_edit.notifications.update_failed')); }