修复组件操作失败时确认弹窗卡住

当组件更新返回 undefined 时关闭替换或移除确认弹窗,避免操作无反馈地停留。
This commit is contained in:
2026-09-12 14:47:01 +08:00
parent 329de5fce9
commit 9788087271
@@ -57,12 +57,15 @@ export function ComponentPanel(props: ComponentPanelProps) {
if (result?.ok) {
setExpanded(true);
setReplaceConfirmationOpen(false);
} else if (result === undefined) {
setReplaceConfirmationOpen(false);
}
}
function removeComponent() {
const result = setComponent(null);
if (result?.ok) setRemoveConfirmationOpen(false);
else if (result === undefined) setRemoveConfirmationOpen(false);
}
return (