From fcb264b1228b2b50c25a0f89c1c1bc644d721469 Mon Sep 17 00:00:00 2001 From: avsirotkin Date: Tue, 5 Apr 2022 11:25:57 +0500 Subject: [PATCH] =?UTF-8?q?=D0=9A=D0=BD=D0=BE=D0=BF=D0=BA=D0=B0=20=D0=BE?= =?UTF-8?q?=D1=82=D0=BF=D1=80=D0=B0=D0=B2=D0=B8=D1=82=D1=8C=20=D0=B7=D0=B0?= =?UTF-8?q?=D0=B1=D0=BB=D0=BE=D0=BA=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD?= =?UTF-8?q?=D0=B0=20=D0=BF=D1=80=D0=B8=20=D0=BE=D1=82=D1=81=D1=83=D1=82?= =?UTF-8?q?=D1=81=D1=82=D0=B2=D0=B8=D0=B8=20=D1=83=D1=81=D1=82=D0=B0=D0=B2?= =?UTF-8?q?=D0=BE=D0=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Telemetry/TelemetryView/Setpoints/SetpointSender.jsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pages/Telemetry/TelemetryView/Setpoints/SetpointSender.jsx b/src/pages/Telemetry/TelemetryView/Setpoints/SetpointSender.jsx index 0073b9d..12006ea 100755 --- a/src/pages/Telemetry/TelemetryView/Setpoints/SetpointSender.jsx +++ b/src/pages/Telemetry/TelemetryView/Setpoints/SetpointSender.jsx @@ -37,20 +37,19 @@ export const SetpointSender = memo(({ idWell, onClose, visible, setpointNames }) const onAdd = useCallback(async (sp) => setSetpoints((prevSp) => { sp.key = Date.now() - prevSp.push(sp) - return prevSp + return [...prevSp, sp] }), []) const onEdit = useCallback(async (sp) => setSetpoints((prevSp) => { const idx = prevSp.findIndex((val) => val.key === sp.key) prevSp[idx] = sp - return prevSp + return [...prevSp] }), []) const onDelete = useCallback(async (sp) => setSetpoints((prevSp) => { const idx = prevSp.findIndex((val) => val.key === sp.key) prevSp.splice(idx, 1) - return prevSp + return [...prevSp] }), []) const onModalOk = useCallback(() => invokeWebApiWrapperAsync( @@ -81,6 +80,7 @@ export const SetpointSender = memo(({ idWell, onClose, visible, setpointNames }) onCancel={onClose} onOk={onModalOk} okText={'Отправить'} + okButtonProps={{ disabled: setpoints.length <= 0 }} >