Skip to content

Commit

Permalink
not record duplicate method, fix #1087
Browse files Browse the repository at this point in the history
  • Loading branch information
fuzhenn committed Jun 18, 2020
1 parent 83316b2 commit ee617b2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/geometry/editor/GeometryEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -1027,6 +1027,13 @@ class GeometryEditor extends Eventable(Class) {
this._historyPointer = 0;
}

if (this._history.length) {
const lastOperation = this._history[this._history.length - 1];
if (lastOperation[0] === method && JSON.stringify(lastOperation[1]) === JSON.stringify(args)) {
return;
}
}

if (this._historyPointer < this._history.length - 1) {
// remove old 'next views'
this._history.splice(this._historyPointer + 1);
Expand Down

0 comments on commit ee617b2

Please sign in to comment.