Skip to content

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

:sparkles: https://github.com/siyuan-note/siyuan/issues/9032

Vanessac1478c2bc1c3
diff --git a/app/electron/main.js b/app/electron/main.js
index c1a665db13..3eb3697366 100644
--- a/app/electron/main.js
+++ b/app/electron/main.js
@@ -811,7 +811,7 @@ app.whenReady().then(() => {
});
});
} else {
- globalShortcut.register(data.hotkey, () => {
+ globalShortcut.register(shortcut, () => {
BrowserWindow.getAllWindows().forEach(itemB => {
itemB.webContents.send("siyuan-hotkey", {
hotkey: item
diff --git a/app/src/boot/onGetConfig.ts b/app/src/boot/onGetConfig.ts
index b1c80a0fd7..903bbbb06c 100644
--- a/app/src/boot/onGetConfig.ts
+++ b/app/src/boot/onGetConfig.ts
@@ -116,7 +116,6 @@ export const onGetConfig = (isStart: boolean, app: App) => {
id: getCurrentWindow().id,
port: location.port
});
- sendGlobalShortcut(app);
webFrame.setZoomFactor(window.siyuan.storage[Constants.LOCAL_ZOOM]);
/// #endif
if (!window.siyuan.config.uiLayout || (window.siyuan.config.uiLayout && !window.siyuan.config.uiLayout.left)) {
@@ -127,6 +126,9 @@ export const onGetConfig = (isStart: boolean, app: App) => {
window.siyuan.emojis = response.data as IEmoji[];
try {
JSONToLayout(app, isStart);
+ /// #if !BROWSER
+ sendGlobalShortcut(app);
+ /// #endif
openChangelog();
} catch (e) {
resetLayout();
@@ -309,7 +311,7 @@ export const initWindow = (app: App) => {
let matchCommand = false;
app.plugins.find(item => {
item.commands.find(command => {
- if (command.globalCallback && data === command.customHotkey) {
+ if (command.globalCallback && data.hotkey === command.customHotkey) {
matchCommand = true;
command.globalCallback();
return true;