Skip to content

Commit

Permalink
Only reset edits for requests on the default context (#32991)
Browse files Browse the repository at this point in the history
Co-authored-by: Riad Benguella <[email protected]>
  • Loading branch information
2 people authored and jorgefilipecosta committed Jun 25, 2021
1 parent f5679e2 commit 8660890
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/core-data/src/reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,11 @@ function entity( entityConfig ) {
edits: ( state = {}, action ) => {
switch ( action.type ) {
case 'RECEIVE_ITEMS':
const context = action?.query?.context ?? 'default';
if ( context !== 'default' ) {
return state;
}

const nextState = { ...state };

for ( const record of action.items ) {
Expand Down

0 comments on commit 8660890

Please sign in to comment.