Vanessa 2023-10-08 11:01:54 +08:00
parent 6f58d1387f
commit e949458180
3 changed files with 6 additions and 11 deletions

View file

@ -111,10 +111,9 @@ export const onGetConfig = (isStart: boolean, app: App) => {
});
}
/// #if !BROWSER
ipcRenderer.send(Constants.SIYUAN_INIT, {
ipcRenderer.invoke(Constants.SIYUAN_INIT, {
languages: window.siyuan.languages["_trayMenu"],
workspaceDir: window.siyuan.config.system.workspaceDir,
id: getCurrentWindow().id,
port: location.port
});
webFrame.setZoomFactor(window.siyuan.storage[Constants.LOCAL_ZOOM]);

View file

@ -1,7 +1,6 @@
import {layoutToJSON} from "../layout/util";
/// #if !BROWSER
import {ipcRenderer} from "electron";
import {getCurrentWindow} from "@electron/remote";
/// #endif
import {Constants} from "../constants";
import {Tab} from "../layout/Tab";
@ -25,7 +24,6 @@ export const openNewWindow = (tab: Tab, options: windowOptions = {}) => {
position: options.position,
width: options.width,
height: options.height,
id: getCurrentWindow().id,
// 需要 encode 否则 https://github.com/siyuan-note/siyuan/issues/9343
url: `${window.location.protocol}//${window.location.host}/stage/build/app/window.html?v=${Constants.SIYUAN_VERSION}&json=${encodeURIComponent(JSON.stringify(json))}`
});
@ -66,7 +64,6 @@ export const openNewWindowById = (id: string, options: windowOptions = {}) => {
position: options.position,
width: options.width,
height: options.height,
id: getCurrentWindow().id,
url: `${window.location.protocol}//${window.location.host}/stage/build/app/window.html?v=${Constants.SIYUAN_VERSION}&json=${encodeURIComponent(JSON.stringify(json))}`
});
/// #endif
@ -81,7 +78,6 @@ export const openNewWindowById = (id: string, options: windowOptions = {}) => {
position: options.position,
width: options.width,
height: options.height,
id: getCurrentWindow().id,
url: `${window.location.protocol}//${window.location.host}/stage/build/app/window.html?v=${Constants.SIYUAN_VERSION}&json=${encodeURIComponent(JSON.stringify(json))}`
});
/// #endif