File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed
apps/frontend/src/pages/tasks.[id].samples.[id]
packages/image-annotator-react/src Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff 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 {
Original file line number Diff line number Diff 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 ) ;
You can’t perform that action at this time.
0 commit comments