From 25d74f7f7f6fe9e61efce229db64c21a859d8d53 Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Mon, 19 Jan 2026 11:31:16 +0800 Subject: [PATCH] =?UTF-8?q?fix(label-studio):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=99=A8=E5=88=9D=E5=A7=8B=E5=8C=96=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E6=97=B6=E7=9A=84=E5=8A=A0=E8=BD=BD=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在初始化失败时也设置 lsReady 状态为 true - 避免页面一直显示"初始化编辑器..."的状态 - 保持原有的错误处理逻辑不变 --- frontend/src/components/business/LabelStudioEmbed.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/business/LabelStudioEmbed.tsx b/frontend/src/components/business/LabelStudioEmbed.tsx index 8063e85..8dfcedb 100644 --- a/frontend/src/components/business/LabelStudioEmbed.tsx +++ b/frontend/src/components/business/LabelStudioEmbed.tsx @@ -93,8 +93,10 @@ export default function LabelStudioEmbed({ } if (msg.type === "LS_ERROR") { - if (onError) onError(msg.payload); - else message.error(msg.payload?.message || "编辑器发生错误"); + // 初始化失败时也需要结束加载状态,避免一直卡在"初始化编辑器..." + setLsReady(true); + if (onError) onError(msg.payload); + else message.error(msg.payload?.message || "编辑器发生错误"); } };