Merge pull request #199 from getmaxun/add-notif

feat: add notification timeout
This commit is contained in:
Karishma Shukla
2024-11-22 23:54:05 +05:30
committed by GitHub
2 changed files with 9 additions and 5 deletions

View File

@@ -103,11 +103,13 @@ export const RobotDuplicationModal = ({ isOpen, handleStart, handleClose, initia
const success = await duplicateRecording(robot.recording_meta.id, targetUrl); const success = await duplicateRecording(robot.recording_meta.id, targetUrl);
if (success) { if (success) {
notify('success', 'Target URL updated successfully.'); notify('success', 'Robot duplicated successfully.');
handleStart(robot); // Inform parent about the updated robot handleStart(robot); // Inform parent about the updated robot
handleClose(); // Close the modal handleClose();
window.location.reload(); setTimeout(() => {
window.location.reload();
}, 1000);
} else { } else {
notify('error', 'Failed to update the Target URL. Please try again.'); notify('error', 'Failed to update the Target URL. Please try again.');
} }

View File

@@ -116,9 +116,11 @@ export const RobotEditModal = ({ isOpen, handleStart, handleClose, initialSettin
if (success) { if (success) {
notify('success', 'Robot updated successfully.'); notify('success', 'Robot updated successfully.');
handleStart(robot); // Inform parent about the updated robot handleStart(robot); // Inform parent about the updated robot
handleClose(); // Close the modal handleClose();
window.location.reload(); setTimeout(() => {
window.location.reload();
}, 1000);
} else { } else {
notify('error', 'Failed to update the robot. Please try again.'); notify('error', 'Failed to update the robot. Please try again.');
} }