diff --git a/packages/core-data/src/resolvers.js b/packages/core-data/src/resolvers.js index d3ca23221eadd0..8f342a6090a031 100644 --- a/packages/core-data/src/resolvers.js +++ b/packages/core-data/src/resolvers.js @@ -450,6 +450,15 @@ export const canUser = .join( '/' ); dispatch.receiveUserPermission( key, permissions[ action ] ); + + // Mark related action resolutions as finished. + if ( action !== requestedAction ) { + dispatch.finishResolution( 'canUser', [ + action, + resource, + id, + ] ); + } } } ); }; diff --git a/packages/core-data/src/test/resolvers.js b/packages/core-data/src/test/resolvers.js index 95a70b5e5c45f9..f9cf7051601f37 100644 --- a/packages/core-data/src/test/resolvers.js +++ b/packages/core-data/src/test/resolvers.js @@ -308,6 +308,7 @@ describe( 'canUser', () => { }; dispatch = Object.assign( jest.fn(), { receiveUserPermission: jest.fn(), + finishResolution: jest.fn(), } ); dispatch.mockReturnValue( ENTITIES ); triggerFetch.mockReset();