Skip to content

Commit

Permalink
Added hasChanges method to Editor
Browse files Browse the repository at this point in the history
  • Loading branch information
rsimon committed Sep 3, 2022
1 parent 03e4fd0 commit 7cd17cc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/editor/Editor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ export default class Editor extends Component {
getCurrentAnnotation = () =>
this.state.currentAnnotation.clone();

hasChanges = () =>
this.props.annotation?.isEqual(this.state.currentAnnotation);

/** Shorthand **/
updateCurrentAnnotation = (diff, saveImmediately) => this.setState({
currentAnnotation: this.state.currentAnnotation.clone(diff)
Expand Down

0 comments on commit 7cd17cc

Please sign in to comment.