Skip to content

Commit e4d3c37

Browse files
authored
Merge pull request #675 from opendatalab/feat/relation-tool
Feat/relation tool
2 parents 3bd4228 + 8335461 commit e4d3c37

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

apps/frontend/src/pages/tasks.[id].samples.[id]/index.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,10 @@ const AnnotationPage = () => {
275275
const [labelMapping, setLabelMapping] = useState<Record<any, string>>();
276276

277277
const handleLabelChange = useCallback((toolName: any, label: ILabel) => {
278+
if (!label) {
279+
return;
280+
}
281+
278282
// 缓存当前标签
279283
setLabelMapping((prev) => {
280284
return {

packages/image-annotator-react/src/ImageAnnotator.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,7 @@ function ForwardAnnotator(
690690
const _label = engine?.activeToolName ? labelMappingByTool[engine.activeToolName][label] : undefined;
691691

692692
setSelectedLabel(_label);
693-
propsOnLabelChange?.(currentTool, _label);
693+
propsOnLabelChange?.(engine!.activeToolName!, _label);
694694
};
695695
// 改变标签
696696
engine?.on('labelChange', handleLabelChange);

0 commit comments

Comments
 (0)