Skip to content

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

:art: https://github.com/siyuan-note/siyuan/issues/3499

Vanessab2a85c66c6f3
diff --git a/app/src/index.ts b/app/src/index.ts
index 3b9b7b1207..8384b5bf3a 100644
--- a/app/src/index.ts
+++ b/app/src/index.ts
@@ -129,6 +129,25 @@ class App {
};
fetchPost("/api/system/getConf", {}, response => {
window.siyuan.config = response.data.conf;
+ // 历史数据兼容,202306后可删除
+ if (!window.siyuan.config.uiLayout.left.data) {
+ window.siyuan.config.uiLayout.left = {
+ pin: true,
+ data: response.data.conf.uiLayout.left
+ }
+ window.siyuan.config.uiLayout.right = {
+ pin: true,
+ data: response.data.conf.uiLayout.right
+ }
+ window.siyuan.config.uiLayout.top = {
+ pin: true,
+ data: response.data.conf.uiLayout.top
+ }
+ window.siyuan.config.uiLayout.bottom = {
+ pin: true,
+ data: response.data.conf.uiLayout.bottom
+ }
+ }
getLocalStorage(() => {
fetchGet(`/appearance/langs/${window.siyuan.config.appearance.lang}.json?v=${Constants.SIYUAN_VERSION}`, (lauguages) => {
window.siyuan.languages = lauguages;
diff --git a/app/src/layout/util.ts b/app/src/layout/util.ts
index e5347ffa67..1f1a12c68c 100644
--- a/app/src/layout/util.ts
+++ b/app/src/layout/util.ts
@@ -172,47 +172,10 @@ export const exportLayout = (reload: boolean, cb?: () => void) => {
const JSONToDock = (json: any) => {
window.siyuan.layout.centerLayout = window.siyuan.layout.layout.children[1].children[1] as Layout;
- // 历史数据兼容,202306后可删除
- let topData: { pin: boolean, data: IDockTab[][] }
- if (!json.top.data) {
- topData = {
- pin: true,
- data: json.top
- }
- } else {
- topData = json.top;
- }
- let bottomData: { pin: boolean, data: IDockTab[][] }
- if (!json.bottom.data) {
- bottomData = {
- pin: true,
- data: json.bottom
- }
- } else {
- bottomData = json.bottom;
- }
- let rightData: { pin: boolean, data: IDockTab[][] }
- if (!json.right.data) {
- rightData = {
- pin: true,
- data: json.right
- }
- } else {
- rightData = json.right;
- }
- let leftData: { pin: boolean, data: IDockTab[][] }
- if (!json.left.data) {
- leftData = {
- pin: true,
- data: json.left
- }
- } else {
- leftData = json.left;
- }
- window.siyuan.layout.topDock = new Dock({position: "Top", data: topData});
- window.siyuan.layout.leftDock = new Dock({position: "Left", data: leftData});
- window.siyuan.layout.rightDock = new Dock({position: "Right", data: rightData});
- window.siyuan.layout.bottomDock = new Dock({position: "Bottom", data: bottomData});
+ window.siyuan.layout.topDock = new Dock({position: "Top", data: json.top});
+ window.siyuan.layout.leftDock = new Dock({position: "Left", data: json.left});
+ window.siyuan.layout.rightDock = new Dock({position: "Right", data: json.right});
+ window.siyuan.layout.bottomDock = new Dock({position: "Bottom", data: json.bottom});
};
export const JSONToCenter = (json: any, layout?: Layout | Wnd | Tab | Model, isStart = false) => {