Skip to content

Commit

Permalink
6.1.1 (#467)
Browse files Browse the repository at this point in the history
* 修复快捷键bug

* 修改版本号6.1.1

* 修复快捷键设置
  • Loading branch information
1zilc authored Jun 19, 2022
1 parent 3fe2bd4 commit 93aa3c1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion release/app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fishing-funds",
"version": "6.1.0",
"version": "6.1.1",
"productName": "Fishing Funds",
"description": "基金,大盘,股票,虚拟货币状态栏显示小应用,基于Electron开发,支持 MacOS,Windows,Linux客户端,数据源来自天天基金,蚂蚁基金,爱基金,腾讯证券,新浪基金等",
"main": "./dist/main/main.js",
Expand Down
13 changes: 8 additions & 5 deletions src/main/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,13 @@ function main() {
touchBarManager.updateEysStatusItems(config);
});
ipcMain.handle('set-hotkey', (event, keys: string) => {
if (!keys) {
globalShortcut.unregister(activeHotkeys);
} else if (activeHotkeys === keys) {
} else {
activeHotkeys = keys;
if (keys === activeHotkeys) {
return;
}
if (activeHotkeys) {
globalShortcut.unregister(activeHotkeys.split(' + ').join('+'));
}
if (keys) {
const accelerator = keys.split(' + ').join('+');
const ret = globalShortcut.register(accelerator, () => {
const isWindowVisible = mb.window?.isVisible();
Expand All @@ -153,6 +155,7 @@ function main() {
}
}
}
activeHotkeys = keys;
});
// menubar 相关监听
mb.on('after-create-window', () => {
Expand Down

0 comments on commit 93aa3c1

Please sign in to comment.