Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:bug: 当前页签没有激活时编辑器没有初始化

Vanessabf2bd552ff6b
diff --git a/app/src/layout/util.ts b/app/src/layout/util.ts
index a90ea5b7da..7882ffb551 100644
--- a/app/src/layout/util.ts
+++ b/app/src/layout/util.ts
@@ -411,8 +411,13 @@ export const layoutToJSON = (layout: Layout | Wnd | Tab | Model, json: any) => {
});
}
} else if (layout instanceof Tab) {
- json.children = {};
- layoutToJSON(layout.model, json.children);
+ if (layout.model) {
+ json.children = {};
+ layoutToJSON(layout.model, json.children);
+ } else {
+ // 当前页签没有激活时编辑器没有初始化
+ json.children = JSON.parse(layout.headElement.getAttribute("data-initdata")||"{}");
+ }
}
};