fix: legacy cap text action naming

This commit is contained in:
Rohit Rajan
2025-11-07 13:23:34 +05:30
parent 85926ae784
commit 2e9125f2b5

View File

@@ -552,16 +552,12 @@ export const RobotEditPage = ({ handleStart }: RobotSettingsProps) => {
pair.what.forEach((action, actionIndex) => { pair.what.forEach((action, actionIndex) => {
if (!editableActions.has(String(action.action))) return; if (!editableActions.has(String(action.action))) return;
let currentName = let currentName = action.name || '';
action.name ||
(action.args && action.args[0] && typeof action.args[0] === 'object') ||
'';
if (!currentName) { if (!currentName) {
switch (action.action) { switch (action.action) {
case 'scrapeSchema': case 'scrapeSchema':
textCount++; currentName = 'Texts';
currentName = `Text ${textCount}`;
break; break;
case 'screenshot': case 'screenshot':
screenshotCount++; screenshotCount++;
@@ -574,9 +570,6 @@ export const RobotEditPage = ({ handleStart }: RobotSettingsProps) => {
} }
} else { } else {
switch (action.action) { switch (action.action) {
case 'scrapeSchema':
textCount++;
break;
case 'screenshot': case 'screenshot':
screenshotCount++; screenshotCount++;
break; break;
@@ -599,10 +592,7 @@ export const RobotEditPage = ({ handleStart }: RobotSettingsProps) => {
switch (action.action) { switch (action.action) {
case 'scrapeSchema': { case 'scrapeSchema': {
const existingName = const existingName = currentName || "Texts";
currentName ||
(action.args && action.args[0] && typeof action.args[0] === "object") ||
"Texts";
if (!textInputs.length) { if (!textInputs.length) {
textInputs.push( textInputs.push(