feat: set first url as recording url and initial url

This commit is contained in:
RohitR311
2025-01-03 19:41:20 +05:30
parent a27e8440a1
commit fcd9c2f484

View File

@@ -85,7 +85,7 @@ export const RecordingsTable = ({ handleEditRecording, handleRunRecording, handl
}, },
]; ];
const { notify, setRecordings, browserId, setBrowserId, recordingUrl, setRecordingUrl, recordingName, setRecordingName, recordingId, setRecordingId } = useGlobalInfoStore(); const { notify, setRecordings, browserId, setBrowserId, setInitialUrl, recordingUrl, setRecordingUrl, recordingName, setRecordingName, recordingId, setRecordingId } = useGlobalInfoStore();
const navigate = useNavigate(); const navigate = useNavigate();
const handleChangePage = (event: unknown, newPage: number) => { const handleChangePage = (event: unknown, newPage: number) => {
@@ -142,6 +142,11 @@ export const RecordingsTable = ({ handleEditRecording, handleRunRecording, handl
handleStartRecording(); handleStartRecording();
}; };
const setBrowserRecordingUrl = (event: React.ChangeEvent<HTMLInputElement>) => {
setInitialUrl(event.target.value);
setRecordingUrl(event.target.value);
}
useEffect(() => { useEffect(() => {
if (rows.length === 0) { if (rows.length === 0) {
fetchRecordings(); fetchRecordings();
@@ -307,7 +312,7 @@ export const RecordingsTable = ({ handleEditRecording, handleRunRecording, handl
variant="outlined" variant="outlined"
fullWidth fullWidth
value={recordingUrl} value={recordingUrl}
onChange={(e: any) => setRecordingUrl(e.target.value)} onChange={setBrowserRecordingUrl}
style={{ marginBottom: '20px', marginTop: '20px' }} style={{ marginBottom: '20px', marginTop: '20px' }}
/> />
<Button <Button