fix(label-studio): 修复编辑器初始化失败时的加载状态问题

- 在初始化失败时也设置 lsReady 状态为 true
- 避免页面一直显示"初始化编辑器..."的状态
- 保持原有的错误处理逻辑不变
This commit is contained in:
2026-01-19 11:31:16 +08:00
parent fb278e206e
commit 25d74f7f7f

View File

@@ -93,8 +93,10 @@ export default function LabelStudioEmbed({
} }
if (msg.type === "LS_ERROR") { 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 || "编辑器发生错误");
} }
}; };