Pull request 1776: client: add transform dynamic lease to static
Updates #3459. Squashed commit of the following: commit 7a660c689da898c125a268f88378e38a58b457da Author: Vladislav Abdulmyanov <v.abdulmyanov@adguard.com> Date: Tue Mar 21 10:40:25 2023 +0200 consider issues commit 066bf77ac44fa8602c66aa0ea220b52fca6d1180 Author: Vladislav Abdulmyanov <v.abdulmyanov@adguard.com> Date: Mon Mar 20 18:37:14 2023 +0200 client: fix icon commit 356b4c3895436f165697510bb3b3abf95f18894f Author: Vladislav Abdulmyanov <v.abdulmyanov@adguard.com> Date: Mon Mar 20 18:32:03 2023 +0200 client: add transform dinamic lease to static
This commit is contained in:
@@ -2,7 +2,7 @@ import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Field, reduxForm } from 'redux-form';
|
||||
import { Trans, useTranslation } from 'react-i18next';
|
||||
import { useDispatch } from 'react-redux';
|
||||
import { useDispatch, useSelector, shallowEqual } from 'react-redux';
|
||||
|
||||
import { renderInputField, normalizeMac } from '../../../../helpers/form';
|
||||
import {
|
||||
@@ -25,6 +25,7 @@ const Form = ({
|
||||
}) => {
|
||||
const { t } = useTranslation();
|
||||
const dispatch = useDispatch();
|
||||
const dynamicLease = useSelector((store) => store.dhcp.leaseModalConfig, shallowEqual);
|
||||
|
||||
const onClick = () => {
|
||||
reset();
|
||||
@@ -87,7 +88,7 @@ const Form = ({
|
||||
<button
|
||||
type="submit"
|
||||
className="btn btn-success btn-standard"
|
||||
disabled={submitting || pristine || processingAdding}
|
||||
disabled={submitting || processingAdding || (pristine && !dynamicLease)}
|
||||
>
|
||||
<Trans>save_btn</Trans>
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user