feat: dont show cancel button
This commit is contained in:
@@ -19,10 +19,17 @@ import { useNavigate, useLocation } from "react-router-dom";
|
|||||||
interface RobotMeta {
|
interface RobotMeta {
|
||||||
name: string;
|
name: string;
|
||||||
id: string;
|
id: string;
|
||||||
|
prebuiltId?: string;
|
||||||
createdAt: string;
|
createdAt: string;
|
||||||
pairs: number;
|
pairs: number;
|
||||||
updatedAt: string;
|
updatedAt: string;
|
||||||
params: any[];
|
params: any[];
|
||||||
|
type?: string;
|
||||||
|
description?: string;
|
||||||
|
usedByUsers?: number[];
|
||||||
|
subscriptionLevel?: number;
|
||||||
|
access?: string;
|
||||||
|
sample?: any[];
|
||||||
url?: string;
|
url?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -73,7 +80,7 @@ export const RobotDuplicatePage = ({ handleStart }: RobotSettingsProps) => {
|
|||||||
const [targetUrl, setTargetUrl] = useState<string | undefined>("");
|
const [targetUrl, setTargetUrl] = useState<string | undefined>("");
|
||||||
const [robot, setRobot] = useState<RobotSettings | null>(null);
|
const [robot, setRobot] = useState<RobotSettings | null>(null);
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
const { recordingId, notify, setRerenderRobots } =
|
const { recordingId, notify, setRerenderRobots} =
|
||||||
useGlobalInfoStore();
|
useGlobalInfoStore();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -132,7 +139,10 @@ export const RobotDuplicatePage = ({ handleStart }: RobotSettingsProps) => {
|
|||||||
t("robot_duplication.notifications.duplicate_success")
|
t("robot_duplication.notifications.duplicate_success")
|
||||||
);
|
);
|
||||||
handleStart(robot);
|
handleStart(robot);
|
||||||
navigate("/robots");
|
const basePath = location.pathname.includes("/prebuilt-robots")
|
||||||
|
? "/prebuilt-robots"
|
||||||
|
: "/robots";
|
||||||
|
navigate(basePath);
|
||||||
} else {
|
} else {
|
||||||
notify("error", t("robot_duplication.notifications.duplicate_error"));
|
notify("error", t("robot_duplication.notifications.duplicate_error"));
|
||||||
}
|
}
|
||||||
@@ -145,7 +155,10 @@ export const RobotDuplicatePage = ({ handleStart }: RobotSettingsProps) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleCancel = () => {
|
const handleCancel = () => {
|
||||||
navigate("/robots");
|
const basePath = location.pathname.includes("/prebuilt-robots")
|
||||||
|
? "/prebuilt-robots"
|
||||||
|
: "/robots";
|
||||||
|
navigate(basePath);
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -156,6 +169,7 @@ export const RobotDuplicatePage = ({ handleStart }: RobotSettingsProps) => {
|
|||||||
saveButtonText={t("robot_duplication.buttons.duplicate")}
|
saveButtonText={t("robot_duplication.buttons.duplicate")}
|
||||||
cancelButtonText={t("robot_duplication.buttons.cancel")}
|
cancelButtonText={t("robot_duplication.buttons.cancel")}
|
||||||
isLoading={isLoading}
|
isLoading={isLoading}
|
||||||
|
showCancelButton={false}
|
||||||
>
|
>
|
||||||
<>
|
<>
|
||||||
<Box style={{ display: "flex", flexDirection: "column" }}>
|
<Box style={{ display: "flex", flexDirection: "column" }}>
|
||||||
@@ -188,4 +202,4 @@ export const RobotDuplicatePage = ({ handleStart }: RobotSettingsProps) => {
|
|||||||
</>
|
</>
|
||||||
</RobotConfigPage>
|
</RobotConfigPage>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
Reference in New Issue
Block a user