From a839c5f63b4e96feccf2ac774ff7f8036de6e338 Mon Sep 17 00:00:00 2001 From: Nate Weller Date: Wed, 15 Jan 2025 19:51:36 -0700 Subject: [PATCH] Fix: hide home report when first protect report scan initializing --- projects/plugins/protect/src/js/routes/home/index.jsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/projects/plugins/protect/src/js/routes/home/index.jsx b/projects/plugins/protect/src/js/routes/home/index.jsx index 26dd89df95c8e..d94529809e3a6 100644 --- a/projects/plugins/protect/src/js/routes/home/index.jsx +++ b/projects/plugins/protect/src/js/routes/home/index.jsx @@ -1,8 +1,7 @@ import { AdminSection, Container, Col, ScanReport } from '@automattic/jetpack-components'; import { useMemo } from 'react'; import AdminPage from '../../components/admin-page'; -import { SCAN_IN_PROGRESS_STATUSES } from '../../constants'; -import useScanStatusQuery from '../../data/scan/use-scan-status-query'; +import useScanStatusQuery, { isScanInProgress } from '../../data/scan/use-scan-status-query'; import HomeAdminSectionHero from './home-admin-section-hero'; import styles from './styles.module.scss'; @@ -34,8 +33,7 @@ const HomePage = () => { [ status ] ); - const showReport = - !! status.lastChecked || SCAN_IN_PROGRESS_STATUSES.indexOf( status?.status ) >= 0; + const showReport = ! isScanInProgress( status ); return (