F4-L1: 还原标准版改整页重载(editor 热切换 setValue 白屏崩溃,F3-1 期间实锤)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-06-12 04:48:42 +08:00
parent 17ee26759f
commit 970f37bf4f

View File

@@ -229,12 +229,11 @@ export function DesignerPage() {
try {
const result = await deleteOverlay(templateId);
if (result.status === 0) {
// 重新加载标准层 schema
const { schema: s, layer: l } = await fetchSchemaWithLayer(templateId);
setSchema(s);
setLayer(l);
currentSchemaRef.current = s;
toast('success', '已还原标准版');
// 不做 editor 热切换:amis-editor 对 value 整体替换(空 overlay→完整标准 schema)
// 会在内部 setValue 路径抛异常导致整页白屏(F3-1 期间实锤复现)。
// 还原后整页重载,editor 以标准层干净重初始化。
window.setTimeout(() => window.location.reload(), 600);
} else {
toast('error', '还原失败:' + result.msg);
}