mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 12:25:15 +08:00
✨ New “isReady” flag to avoid invalid page content
Before this change, the onboarding wizard was briefly displayed on every page load
This commit is contained in:
parent
6a80a016cf
commit
3d05c65f50
6 changed files with 30 additions and 1 deletions
|
@ -2,7 +2,7 @@ import { dispatch } from '@wordpress/data';
|
|||
import { __ } from '@wordpress/i18n';
|
||||
import { apiFetch } from '@wordpress/data-controls';
|
||||
import { NAMESPACE } from '../constants';
|
||||
import { setOnboardingDetails } from './actions';
|
||||
import { setIsReady, setOnboardingDetails } from './actions';
|
||||
|
||||
/**
|
||||
* Retrieve settings from the site's REST API.
|
||||
|
@ -13,6 +13,7 @@ export function* getPersistentData() {
|
|||
try {
|
||||
const result = yield apiFetch( { path } );
|
||||
yield setOnboardingDetails( result );
|
||||
yield setIsReady( true );
|
||||
} catch ( e ) {
|
||||
yield dispatch( 'core/notices' ).createErrorNotice(
|
||||
__(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue