Fixed FIFO for post revisions (#16696)
no issue - with this change, the oldest revision will be deleted and the new revision will be added if the limit is reached
This commit is contained in:
parent
9ab4579084
commit
857a5ad004
@ -80,7 +80,9 @@ class PostRevisions {
|
||||
];
|
||||
}
|
||||
|
||||
return [currentRevision, ...revisions].slice(0, this.config.max_revisions);
|
||||
// Grab the most recent revisions, limited by max_revisions
|
||||
const updatedRevisions = [...revisions, currentRevision];
|
||||
return updatedRevisions.slice(updatedRevisions.length - this.config.max_revisions, updatedRevisions.length);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user