From b652cf49bfda3f9ff57f3b27768ea4843bbeefd0 Mon Sep 17 00:00:00 2001 From: Robert Date: Mon, 11 Mar 2024 21:03:54 +0700 Subject: [PATCH] removed unnecessary --- .../ui/ChangeWaitForButton.tsx | 32 +++---------------- src/widgets/action-editor/ui/ActionEditor.tsx | 6 ---- 2 files changed, 4 insertions(+), 34 deletions(-) diff --git a/src/features/change-wait-for/ui/ChangeWaitForButton.tsx b/src/features/change-wait-for/ui/ChangeWaitForButton.tsx index 29b7e8f..b4d0da1 100644 --- a/src/features/change-wait-for/ui/ChangeWaitForButton.tsx +++ b/src/features/change-wait-for/ui/ChangeWaitForButton.tsx @@ -11,10 +11,6 @@ import { DialogContent, Typography, TextField, - FormControl, - Select, - MenuItem, - InputLabel, DialogActions, Button, } from "@mui/material"; @@ -38,19 +34,15 @@ export default function ChangeWaitForButton({ const getChain = useChainState((state) => state.getChain); const updateAction = useChainState((state) => state.updateAction); - const [waitType, setWaitType] = useState<"seconds" | "minutes">( - action.waitFor! >= 60 ? "minutes" : "seconds", - ); - const [waitFor, setWaitFor] = useState( - action.waitFor >= 60 ? action.waitFor / 60 : action.waitFor, + action.waitFor >= 60 ? action.waitFor / 60 : 1, ); async function handleSave() { setLoading(true); let cleanWaitFor: number; - if (waitFor === "") { + if (waitFor === "" || waitFor === "0") { cleanWaitFor = 1; } else if (typeof waitFor === "string") { cleanWaitFor = parseInt(waitFor); @@ -58,7 +50,7 @@ export default function ChangeWaitForButton({ cleanWaitFor = waitFor; } - action.waitFor = waitType === "seconds" ? cleanWaitFor : cleanWaitFor * 60; + action.waitFor = cleanWaitFor > 10 ? 10 * 60 : cleanWaitFor * 60; updateAction(chainId, actionIndex, action); const chain = getChain(chainId)!; @@ -113,27 +105,11 @@ export default function ChangeWaitForButton({ name="waitFor" fullWidth variant="outlined" - label="Время" + label="Минуты" autoComplete="off" value={waitFor} onChange={(event) => setWaitFor(event.target.value)} /> - - - Тип - - diff --git a/src/widgets/action-editor/ui/ActionEditor.tsx b/src/widgets/action-editor/ui/ActionEditor.tsx index eebd572..daec2b0 100644 --- a/src/widgets/action-editor/ui/ActionEditor.tsx +++ b/src/widgets/action-editor/ui/ActionEditor.tsx @@ -9,7 +9,6 @@ import { Button, TextField } from "@mui/material"; import TextFieldsIcon from "@mui/icons-material/TextFields"; import ImageIcon from "@mui/icons-material/Image"; import RecordVoiceOverIcon from "@mui/icons-material/RecordVoiceOver"; -import VideocamIcon from "@mui/icons-material/Videocam"; interface TabPanelProps { children?: React.ReactNode; @@ -87,7 +86,6 @@ export default function ActionEditor({ icon={} {...a11yProps(2)} /> - } {...a11yProps(3)} /> @@ -114,10 +112,6 @@ export default function ActionEditor({ In progress - - - In progress -