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 }} >