Added hasChanges method to Editor

This commit is contained in:
Rainer Simon 2022-09-03 19:09:23 +02:00
parent 03e4fd045b
commit 7cd17cc8ca
1 changed files with 3 additions and 0 deletions

View File

@ -122,6 +122,9 @@ export default class Editor extends Component {
getCurrentAnnotation = () => getCurrentAnnotation = () =>
this.state.currentAnnotation.clone(); this.state.currentAnnotation.clone();
hasChanges = () =>
this.props.annotation?.isEqual(this.state.currentAnnotation);
/** Shorthand **/ /** Shorthand **/
updateCurrentAnnotation = (diff, saveImmediately) => this.setState({ updateCurrentAnnotation = (diff, saveImmediately) => this.setState({
currentAnnotation: this.state.currentAnnotation.clone(diff) currentAnnotation: this.state.currentAnnotation.clone(diff)