|
9 | 9 | // OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions and |
10 | 10 | // limitations under the License. |
11 | 11 | import {ClusterStatus} from '../../types/clusters' |
12 | | -import React from 'react' |
| 12 | +import React, {useMemo} from 'react' |
13 | 13 | import {useNavigate} from 'react-router-dom' |
14 | 14 |
|
15 | 15 | import {setState, useState, ssmPolicy, consoleDomain} from '../../store' |
@@ -45,7 +45,10 @@ export default function Actions() { |
45 | 45 |
|
46 | 46 | const apiVersion = useState(['app', 'version', 'full']) |
47 | 47 | const clusterVersion = useState([...clusterPath, 'version']) |
48 | | - const versionSupported = apiVersion.includes(clusterVersion) |
| 48 | + const versionSupported = useMemo(() => |
| 49 | + apiVersion.includes(clusterVersion), |
| 50 | + [apiVersion, clusterVersion] |
| 51 | + ); |
49 | 52 |
|
50 | 53 | const fleetStatus = useState([...clusterPath, 'computeFleetStatus']) |
51 | 54 | const clusterStatus = useState([...clusterPath, 'clusterStatus']) |
@@ -74,9 +77,9 @@ export default function Actions() { |
74 | 77 | const isEditDisabled = |
75 | 78 | clusterStatus === ClusterStatus.CreateInProgress || |
76 | 79 | clusterStatus === ClusterStatus.DeleteInProgress || |
77 | | - clusterStatus === ClusterStatus.UpdateInProgress |
78 | | - // clusterStatus === ClusterStatus.CreateFailed || |
79 | | - // !versionSupported |
| 80 | + clusterStatus === ClusterStatus.UpdateInProgress || |
| 81 | + clusterStatus === ClusterStatus.CreateFailed || |
| 82 | + !versionSupported |
80 | 83 | const isStartFleetDisabled = fleetStatus !== 'STOPPED' |
81 | 84 | const isStopFleetDisabled = fleetStatus !== 'RUNNING' |
82 | 85 | const isDeleteDisabled = |
|
0 commit comments