修复组件操作失败时确认弹窗卡住
当组件更新返回 undefined 时关闭替换或移除确认弹窗,避免操作无反馈地停留。
This commit is contained in:
+3
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user