0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00

Avoided inserting actions if nothing has changed

refs #10431

- I thought i have added this protection, but got removed via the simplification in cca3317a11
This commit is contained in:
kirrg001 2019-02-07 20:49:35 +01:00
parent b25da62cca
commit 2eb1f2a507

View file

@ -100,6 +100,10 @@ proto = ghostBookshelf.Model.prototype;
* We could embedd adding actions more nicely in the future e.g. plugin.
*/
const addAction = (model, event, options) => {
if (model._changed && !Object.keys(model._changed).length) {
return;
}
// CASE: model does not support actions at all
if (!model.getAction) {
return;