Skip to content

Commit

Permalink
Minor code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
delawski committed Sep 27, 2021
1 parent b51bf2e commit e97abb3
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions assets/src/components/site-scan-context-provider/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ export function SiteScanContextProvider( {
hasUnmounted.current = true;
}, [] );

const startSiteScan = useCallback( () => {
setSiteScanState( SITE_SCAN_STATE_IDLE );
}, [] );

/**
* Allows cancelling a scan that is in progress.
*/
Expand Down Expand Up @@ -146,19 +150,16 @@ export function SiteScanContextProvider( {

return (
<SiteScan.Provider
value={
{
cancelSiteScan,
canScanSite: siteScanState === SITE_SCAN_STATE_READY,
currentlyScannedUrlIndex,
fetchingScannableUrls,
pluginIssues,
scannableUrls,
siteScanComplete: siteScanState === SITE_SCAN_STATE_COMPLETE,
startSiteScan: () => setSiteScanState( SITE_SCAN_STATE_IDLE ),
themeIssues,
}
}
value={ {
canScanSite: siteScanState === SITE_SCAN_STATE_READY,
cancelSiteScan,
currentlyScannedUrlIndex,
pluginIssues,
scannableUrls,
siteScanComplete: siteScanState === SITE_SCAN_STATE_COMPLETE,
startSiteScan,
themeIssues,
} }
>
{ children }
</SiteScan.Provider>
Expand Down

0 comments on commit e97abb3

Please sign in to comment.