Skip to content

Commit ff3f6ef

Browse files
committed
fix(frontend): global tools data
1 parent af680d5 commit ff3f6ef

File tree

1 file changed

+4
-4
lines changed
  • apps/frontend/src/pages/tasks.[id].samples.[id]/components/annotationRightCorner

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,16 +249,16 @@ const AnnotationRightCorner = ({ noSave, fetchNext, totalSize }: AnnotationRight
249249
}
250250

251251
// 全局标注没有值的话,填充默认值
252-
if (!result.tagTool?.result?.length) {
253-
const tagConfig = task.config.tools.find((tool) => tool.tool === 'tagTool');
252+
const tagConfig = task.config.tools.find((tool) => tool.tool === 'tagTool');
253+
if (!result.tagTool?.result?.length && tagConfig) {
254254
result.tagTool = {
255255
toolName: 'tagTool',
256256
result: generateDefaultValues(tagConfig?.config.attributes),
257257
};
258258
}
259259

260-
if (!result.textTool?.result?.length) {
261-
const textConfig = task.config.tools.find((tool) => tool.tool === 'textTool');
260+
const textConfig = task.config.tools.find((tool) => tool.tool === 'textTool');
261+
if (!result.textTool?.result?.length && textConfig) {
262262
result.textTool = {
263263
toolName: 'textTool',
264264
result: generateDefaultValues(textConfig?.config.attributes),

0 commit comments

Comments
 (0)