Skip to content

Commit

Permalink
fix(history): do not record unchanged data
Browse files Browse the repository at this point in the history
  • Loading branch information
huoteng authored and liujuping committed Dec 8, 2022
1 parent 5de97c1 commit 335314a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/designer/src/document/history.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ export class History<T = NodeSchema> {
if (this.asleep) return;
untracked(() => {
const log = this.currentSerialization.serialize(data);

// do not record unchanged data
if (this.session.data === log) {
return;
}

if (this.session.isActive()) {
this.session.log(log);
} else {
Expand Down

0 comments on commit 335314a

Please sign in to comment.