失败弹窗的 agent 按钮改成早返回式赋值
xiaohongshu/FailureDialog.tsx:嵌套三元改成 if 块,保持「文案与 handler 一起定」不变。
This commit is contained in:
+8
-5
@@ -39,13 +39,16 @@ export function FailureDialog({
|
||||
}) {
|
||||
const repairability = failure ? classifyXhsMinitoolFailure(failure) : null;
|
||||
// 文案与点击处理一起定:只存一句中文再按它反查 handler 的话,改文案就会静默接错动作。
|
||||
const agentAction =
|
||||
!failure ||
|
||||
repairability === XhsMinitoolFailureRepairability.OnlyHumanRepairable
|
||||
? null
|
||||
: failure.type === 'buildScriptMissing'
|
||||
let agentAction: { label: string; onClick: () => void } | null = null;
|
||||
if (
|
||||
failure &&
|
||||
repairability !== XhsMinitoolFailureRepairability.OnlyHumanRepairable
|
||||
) {
|
||||
agentAction =
|
||||
failure.type === 'buildScriptMissing'
|
||||
? { label: '让陶泥儿帮我调通', onClick: onAdapt }
|
||||
: { label: '让陶泥儿来修', onClick: onRepair };
|
||||
}
|
||||
|
||||
return (
|
||||
<ThemedModal
|
||||
|
||||
Reference in New Issue
Block a user