diff --git a/src/LabelStudio.js b/src/LabelStudio.js index f0f6c6fd5..29541ec5b 100644 --- a/src/LabelStudio.js +++ b/src/LabelStudio.js @@ -79,6 +79,8 @@ export class LabelStudio { }; const clearRenderedApp = () => { + if (!rootElement.childNodes?.length) return; + const childNodes = [...rootElement.childNodes]; // cleanDomAfterReact needs this key to be sure that cleaning affects only current react subtree const reactKey = findReactKey(childNodes[0]); diff --git a/src/regions/VideoRegion.js b/src/regions/VideoRegion.js index 231320c3f..c8cda9e8d 100644 --- a/src/regions/VideoRegion.js +++ b/src/regions/VideoRegion.js @@ -1,4 +1,4 @@ -import { types } from 'mobx-state-tree'; +import { getRoot, types } from 'mobx-state-tree'; import { guidGenerator } from '../core/Helpers'; import { AreaMixin } from '../mixins/AreaMixin'; @@ -34,7 +34,7 @@ const Model = types }, get annotation() { - return self.object.annotation; + return getRoot(self)?.annotationStore?.selected; }, getShape() {