Skip to content

Commit

Permalink
fix: OPTIC-353: Fix null errors when switching from task detail to se…
Browse files Browse the repository at this point in the history
…ttings (HumanSignal#1665)

* fix: optic-353: fix null errors when switching from task detail to settings

* null block children before state tree destroy

* Update src/LabelStudio.js

Co-authored-by: hlomzik <[email protected]>

* fix null block logic for children

* commiting console to understand the difference between local and deployed

* destroy annotaions first

* use getRoot to find the selected annotation for video region

* revert image selection

* Update src/stores/AppStore.js

Co-authored-by: Sergey <[email protected]>

* check if annotation store exists from root

* allow no conditional assignment for while loop

---------

Co-authored-by: hlomzik <[email protected]>
Co-authored-by: Sergey <[email protected]>
  • Loading branch information
3 people authored and MasherJames committed Feb 29, 2024
1 parent ba7a6aa commit 19b1baa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/LabelStudio.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down
4 changes: 2 additions & 2 deletions src/regions/VideoRegion.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -34,7 +34,7 @@ const Model = types
},

get annotation() {
return self.object.annotation;
return getRoot(self)?.annotationStore?.selected;
},

getShape() {
Expand Down

0 comments on commit 19b1baa

Please sign in to comment.