Specify args for wp.data resolution in marketing page to support WP 5.9 (#37198)
This commit is contained in:
commit
98dcb9bea4
|
@ -40,7 +40,7 @@ export const useRecommendedChannels = (): UseRecommendedChannels => {
|
||||||
} );
|
} );
|
||||||
|
|
||||||
return {
|
return {
|
||||||
loading: ! hasFinishedResolution( 'getRecommendedChannels' ),
|
loading: ! hasFinishedResolution( 'getRecommendedChannels', [] ),
|
||||||
data: nonActiveRecommendedChannels,
|
data: nonActiveRecommendedChannels,
|
||||||
error,
|
error,
|
||||||
};
|
};
|
||||||
|
|
|
@ -63,7 +63,7 @@ export const useRegisteredChannels = (): UseRegisteredChannels => {
|
||||||
const { invalidateResolution } = useDispatch( STORE_KEY );
|
const { invalidateResolution } = useDispatch( STORE_KEY );
|
||||||
|
|
||||||
const refetch = useCallback( () => {
|
const refetch = useCallback( () => {
|
||||||
invalidateResolution( 'getRegisteredChannels' );
|
invalidateResolution( 'getRegisteredChannels', [] );
|
||||||
}, [ invalidateResolution ] );
|
}, [ invalidateResolution ] );
|
||||||
|
|
||||||
return useSelect( ( select ) => {
|
return useSelect( ( select ) => {
|
||||||
|
@ -72,7 +72,7 @@ export const useRegisteredChannels = (): UseRegisteredChannels => {
|
||||||
const state = getRegisteredChannels< RegisteredChannelsState >();
|
const state = getRegisteredChannels< RegisteredChannelsState >();
|
||||||
|
|
||||||
return {
|
return {
|
||||||
loading: ! hasFinishedResolution( 'getRegisteredChannels' ),
|
loading: ! hasFinishedResolution( 'getRegisteredChannels', [] ),
|
||||||
data: state.data?.map( convert ),
|
data: state.data?.map( convert ),
|
||||||
error: state.error,
|
error: state.error,
|
||||||
refetch,
|
refetch,
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
Significance: patch
|
||||||
|
Type: fix
|
||||||
|
|
||||||
|
Fix WP data resolution (`invalidateResolution`) not working with WP 5.9 in marketing page.
|
Loading…
Reference in New Issue