fix: robot target url

This commit is contained in:
karishmas6
2024-10-25 20:12:18 +05:30
parent 4e1512c815
commit 9227da7ce9

View File

@@ -71,6 +71,11 @@ export const RobotSettingsModal = ({ isOpen, handleStart, handleClose, initialSe
}
}
const lastPair = robot?.recording.workflow[robot?.recording.workflow.length - 1];
// Find the `goto` action in `what` and retrieve its arguments
const targetUrl = lastPair?.what.find(action => action.action === "goto")?.args?.[0];
return (
<GenericModal
isOpen={isOpen}
@@ -85,7 +90,7 @@ export const RobotSettingsModal = ({ isOpen, handleStart, handleClose, initialSe
<>
<TextField
label="Robot Target URL"
value={robot.recording.workflow[0].where.url}
value={targetUrl}
InputProps={{
readOnly: true,
}}