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 and noisysocks committed Nov 22, 2021
1 parent 0f6ecc7 commit 9db30d7
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 9db30d7

Please sign in to comment.