Skip to content

Commit

Permalink
Changes to ensure refresh doesn't bypass things
Browse files Browse the repository at this point in the history
  • Loading branch information
officiallygod committed May 17, 2024
1 parent c945894 commit 90c6d40
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
HEADER_SITEGEN,
pluginDashboardPage,
} from '../../../../../constants';
import { setFlow } from '../../../../utils/api/flow';

const SiteGenStepErrorState = () => {
const navigate = useNavigate();
Expand Down Expand Up @@ -105,8 +106,9 @@ const SiteGenStepErrorState = () => {
navigate( data.steps[ 1 ].path );
};

const handleRetry = () => {
const handleRetry = async () => {
updateSiteGenErrorStatus( false );
await setFlow( currentData );
};

const handleGoBack = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,15 @@ const SiteGen = () => {
return;
}

// If retries are exhausted don't make requests
if (
currentData.sitegen?.siteGenErrorMeta?.retryCount >=
currentData.sitegen?.siteGenErrorMeta?.maxRetryCount
) {
updateSiteGenErrorStatus( true );
return;
}

setIsGeneratingSiteMeta( true );

if ( ! window.nfdOnboarding?.siteGenTimerInterval ) {
Expand Down

0 comments on commit 90c6d40

Please sign in to comment.