Skip to content

Commit

Permalink
Save the edited entity record to a const and then invert it to determ…
Browse files Browse the repository at this point in the history
…ine whether we should invalidate the recordds
  • Loading branch information
scruffian committed Jun 29, 2023
1 parent d88aa4d commit dcadb54
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions packages/core-data/src/resolvers.js
Original file line number Diff line number Diff line change
Expand Up @@ -588,14 +588,12 @@ export const getNavigationFallbackId =
// If the fallback is already in the store, don't invalidate navigation queries.
// Otherwise, invalidate the cache for the scenario where there were no Navigation
// posts in the state and the fallback created one.
const invalidateNavigationQueries = select.getEntityRecord(
const existingFallbackEntityRecord = select.getEntityRecord(
'postType',
'wp_navigation',
fallback?.id
)
? false
: true;

);
const invalidateNavigationQueries = ! existingFallbackEntityRecord;
dispatch.receiveEntityRecords(
'postType',
'wp_navigation',
Expand Down

0 comments on commit dcadb54

Please sign in to comment.