瀏覽代碼

:bug: open new window

Vanessa 2 年之前
父節點
當前提交
0b001595
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      app/src/window/openNewWindow.ts

+ 3 - 1
app/src/window/openNewWindow.ts

@@ -43,7 +43,9 @@ export const openNewWindowById = (id: string) => {
         };
         if (response.data.rootID === id) {
             fetchPost("/api/attr/getBlockAttrs", {id}, (attrResponse) => {
-                json.children.scrollAttr = JSON.parse(attrResponse.data.scroll || "{}");
+                if (attrResponse.data.scroll) {
+                    json.children.scrollAttr = JSON.parse(attrResponse.data.scroll);
+                }
                 /// #if !BROWSER
                 ipcRenderer.send(Constants.SIYUAN_OPENWINDOW, {
                     id: getCurrentWindow().id,