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:
Philipp Stracker 2024-10-28 18:57:39 +01:00
parent 6a80a016cf
commit 3d05c65f50
No known key found for this signature in database
6 changed files with 30 additions and 1 deletions

View file

@ -3,6 +3,19 @@ import { apiFetch } from '@wordpress/data-controls';
import ACTION_TYPES from './action-types';
import { NAMESPACE, STORE_NAME } from '../constants';
/**
* Non-persistent. Marks the onboarding details as "ready", i.e., fully initialized.
*
* @param {boolean} isReady
* @return {{type: string, isReady}} The action.
*/
export const setIsReady = ( isReady ) => {
return {
type: ACTION_TYPES.SET_ONBOARDING_IS_READY,
isReady,
};
};
/**
* Non-persistent. Changes the "saving" flag.
*