Skip to content

Commit

Permalink
Do not render outdated security reports summary (#4083)
Browse files Browse the repository at this point in the history
  • Loading branch information
cynthia-sg authored Oct 8, 2024
1 parent e850481 commit a40ec5f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions web/src/layout/package/securityReport/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ interface Props {
}

const SecurityReport = (props: Props) => {
const [isOlderThenOneYear, setIsOlderThenOneYear] = useState<boolean>(false);
const [isOlderThanOneYear, setIsOlderThanOneYear] = useState<boolean>(true);

const hasSomeWhitelistedContainers = useCallback((): boolean => {
return props.containers.some((container: ContainerImage) => container.whitelisted);
Expand All @@ -51,11 +51,11 @@ const SecurityReport = (props: Props) => {

useEffect(() => {
const diffInYears = calculateDiffInYears(props.ts);
setIsOlderThenOneYear(diffInYears > 1);
setIsOlderThanOneYear(diffInYears > 1);
}, [props.ts]);

// Do not display security reports when version is older than 1 year
if (isOlderThenOneYear) return null;
if (isOlderThanOneYear) return null;

if (!props.disabledReport) {
if (isNull(props.summary) || isUndefined(props.summary) || isEmpty(props.summary)) {
Expand Down

0 comments on commit a40ec5f

Please sign in to comment.