From 101acd49e490235d2f67aad73480f69933bf44ea Mon Sep 17 00:00:00 2001 From: RohitR311 Date: Fri, 22 Nov 2024 23:39:34 +0530 Subject: [PATCH 1/4] feat: add notification timeout --- src/components/molecules/RobotDuplicate.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/molecules/RobotDuplicate.tsx b/src/components/molecules/RobotDuplicate.tsx index 3fe6abb7..8029d7dd 100644 --- a/src/components/molecules/RobotDuplicate.tsx +++ b/src/components/molecules/RobotDuplicate.tsx @@ -103,11 +103,13 @@ export const RobotDuplicationModal = ({ isOpen, handleStart, handleClose, initia const success = await duplicateRecording(robot.recording_meta.id, targetUrl); if (success) { - notify('success', 'Target URL updated successfully.'); + notify('success', 'Robot duplicated successfully.'); handleStart(robot); // Inform parent about the updated robot handleClose(); // Close the modal - window.location.reload(); + setTimeout(() => { + window.location.reload(); + }, 1000); } else { notify('error', 'Failed to update the Target URL. Please try again.'); } From 714c77e0c4a4be1104782da483d67a9dad0c4a47 Mon Sep 17 00:00:00 2001 From: RohitR311 Date: Fri, 22 Nov 2024 23:40:05 +0530 Subject: [PATCH 2/4] feat: add notification timeout --- src/components/molecules/RobotEdit.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/molecules/RobotEdit.tsx b/src/components/molecules/RobotEdit.tsx index f68beee2..7148ba56 100644 --- a/src/components/molecules/RobotEdit.tsx +++ b/src/components/molecules/RobotEdit.tsx @@ -118,7 +118,9 @@ export const RobotEditModal = ({ isOpen, handleStart, handleClose, initialSettin handleStart(robot); // Inform parent about the updated robot handleClose(); // Close the modal - window.location.reload(); + setTimeout(() => { + window.location.reload(); + }, 1000); } else { notify('error', 'Failed to update the robot. Please try again.'); } From 42746ec3ed2754216ab7ebf2513b9f93a3f2bea4 Mon Sep 17 00:00:00 2001 From: RohitR311 Date: Fri, 22 Nov 2024 23:48:56 +0530 Subject: [PATCH 3/4] chore: rm comments for handleClose --- src/components/molecules/RobotDuplicate.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/molecules/RobotDuplicate.tsx b/src/components/molecules/RobotDuplicate.tsx index 8029d7dd..850614b0 100644 --- a/src/components/molecules/RobotDuplicate.tsx +++ b/src/components/molecules/RobotDuplicate.tsx @@ -105,7 +105,7 @@ export const RobotDuplicationModal = ({ isOpen, handleStart, handleClose, initia if (success) { notify('success', 'Robot duplicated successfully.'); handleStart(robot); // Inform parent about the updated robot - handleClose(); // Close the modal + handleClose(); setTimeout(() => { window.location.reload(); From c93953a7ad4658ac3d198bf33135dd8aaa32d81c Mon Sep 17 00:00:00 2001 From: RohitR311 Date: Fri, 22 Nov 2024 23:49:15 +0530 Subject: [PATCH 4/4] chore: rm comments for handleClose --- src/components/molecules/RobotEdit.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/molecules/RobotEdit.tsx b/src/components/molecules/RobotEdit.tsx index 7148ba56..74b50f62 100644 --- a/src/components/molecules/RobotEdit.tsx +++ b/src/components/molecules/RobotEdit.tsx @@ -116,7 +116,7 @@ export const RobotEditModal = ({ isOpen, handleStart, handleClose, initialSettin if (success) { notify('success', 'Robot updated successfully.'); handleStart(robot); // Inform parent about the updated robot - handleClose(); // Close the modal + handleClose(); setTimeout(() => { window.location.reload();