Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

fix: OPTIC-353: Fix null errors when switching from task detail to settings #1665

Merged
merged 13 commits into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
6 changes: 4 additions & 2 deletions src/stores/AppStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -875,12 +875,14 @@ export default types
const children = [];

walk(self, (node) => {
if (!isRoot(node) && getParent(node) === self) children.push(node);
if (!isRoot(node) && getParent(node) === self) {
children.push(node);
}
});

let node;

while ((node = children.shift())) {
while (node = children.shift()) {
Travis1282 marked this conversation as resolved.
Show resolved Hide resolved
try {
destroy(node);
} catch (e) {
Expand Down
Loading