dombizita commented on code in PR #3907:
URL: https://github.com/apache/ozone/pull/3907#discussion_r1014024491


##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/insights/insights.tsx:
##########
@@ -89,8 +89,14 @@ export class Insights extends React.Component<Record<string, 
object>, IInsightsS
     // selected buckets value should be reset to all buckets
     let selectedBuckets = [allBucketsOption];
     // Update bucket options only if one volume is selected
-    if (selectedVolumes && selectedVolumes.length === 1) {
-      const selectedVolume = selectedVolumes[0].value;
+    if (((selectedVolumes && selectedVolumes.length != null) && 
(selectedVolumes.length === 2 && selectedVolumes[0].value === '*')) || 
(selectedVolumes.length === 1)){

Review Comment:
   I think the brackets wasn't at good place previously. So there is a `AND` 
after the `selectedVolumes`(like it was originally in the code) and after that 
inside the brackets there is an `OR`, where we need the length to be either 1 
or 2. If we are checking that it either needs to be 1 or 2, why do we need the 
null check before that? Please check my suggestion in this comment.
   ```suggestion
       if (selectedVolumes && ((selectedVolumes.length === 2 && 
selectedVolumes[0].value === '*') || (selectedVolumes.length === 1))){
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to