Skip to content

Commit

Permalink
Multi-entity save: Only set site entity to pending if really saving (#…
Browse files Browse the repository at this point in the history
…36573)

Currently, the multi-entity save panel is unconditionally attempting to save changes to the site entity, even if there aren't any. This causes the site entity saving state to be set to "pending" at least for a short period of time.

This commit makes it so that we only save the site entity if there are any changes to it.
  • Loading branch information
ockham authored Nov 17, 2021
1 parent eccb664 commit eb9c1c4
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,14 @@ export default function EntitiesSavedStates( { close } ) {
saveEditedEntityRecord( kind, name, key );
}
} );
saveSpecifiedEntityEdits( 'root', 'site', undefined, siteItemsToSave );
if ( siteItemsToSave.length ) {
saveSpecifiedEntityEdits(
'root',
'site',
undefined,
siteItemsToSave
);
}
};

// Explicitly define this with no argument passed. Using `close` on
Expand Down

0 comments on commit eb9c1c4

Please sign in to comment.