Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 07884760 authored by Yannick Li's avatar Yannick Li
Browse files

Set push timeout only when there has been a write

parent 0b95a748
No related branches found
No related tags found
2 merge requests!38Resolve "Release v1.2.0",!36Resolve "Provide a callback for notification"
......@@ -111,7 +111,6 @@ export default class CMDEditor extends Component<
}
clearTimeout(this.timeoutPush);
if (!this.isDirty) {
this.setPushTimeout();
return;
}
......@@ -121,7 +120,6 @@ export default class CMDEditor extends Component<
if (diffs.length === 1 && diffs[0][0] === DiffMatchPatch.DIFF_EQUAL) {
// Same value
this.isDirty = false;
this.setPushTimeout();
return;
}
......@@ -148,7 +146,6 @@ export default class CMDEditor extends Component<
});
this.oldValue = this.state.value;
this.isDirty = false;
this.setPushTimeout();
}
/**
......@@ -313,7 +310,10 @@ export default class CMDEditor extends Component<
const valueUI = typeof value == "undefined" ? "" : value;
if (this.state.value === valueUI) return;
this.isDirty = true;
if (!this.isDirty) {
this.isDirty = true;
this.setPushTimeout();
}
this.setState({
value: valueUI,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment