From 7cd17cc8cab148826079dc6a395683e706a21671 Mon Sep 17 00:00:00 2001 From: Rainer Simon Date: Sat, 3 Sep 2022 19:09:23 +0200 Subject: [PATCH] Added hasChanges method to Editor --- src/editor/Editor.jsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/editor/Editor.jsx b/src/editor/Editor.jsx index 8716557..864138a 100644 --- a/src/editor/Editor.jsx +++ b/src/editor/Editor.jsx @@ -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)