Skip to content

Commit

Permalink
Optimizing if condition.
Browse files Browse the repository at this point in the history
Signed-off-by: Yurii Vlasov <yuriy@vlasov.pro>
  • Loading branch information
vlasov-y committed Jan 7, 2025
1 parent 2d20937 commit d0c095a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions frontend/src/components/common/Resource/Resource.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -583,11 +583,11 @@ function ContainerEnvironmentVariables(props: EnvironmentVariablesProps) {
const { t } = useTranslation();
const [copied, setCopied] = React.useState(false);

if (!container?.env && !container?.envFrom) {
return null;
} else if (!pod?.status?.containerStatuses) {
return null;
} else if (!pod?.metadata?.namespace) {
if (
(!container?.env && !container?.envFrom) ||
!pod?.status?.containerStatuses ||
!pod?.metadata?.namespace
) {
return null;
}

Expand Down

0 comments on commit d0c095a

Please sign in to comment.