mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-19 06:30:10 +08:00
fix: can hide when close the app to tray (#11282)
* fix: can hide when close the app to tray * format code * udpate version
This commit is contained in:
parent
4e699c48bc
commit
a1a3b9bd96
@ -259,7 +259,7 @@
|
||||
"dotenv-cli": "^7.4.2",
|
||||
"drizzle-kit": "^0.31.4",
|
||||
"drizzle-orm": "^0.44.5",
|
||||
"electron": "38.4.0",
|
||||
"electron": "38.7.0",
|
||||
"electron-builder": "26.0.15",
|
||||
"electron-devtools-installer": "^3.2.0",
|
||||
"electron-reload": "^2.0.0-alpha.1",
|
||||
@ -387,7 +387,7 @@
|
||||
"esbuild": "^0.25.0",
|
||||
"file-stream-rotator@npm:^0.6.1": "patch:file-stream-rotator@npm%3A0.6.1#~/.yarn/patches/file-stream-rotator-npm-0.6.1-eab45fb13d.patch",
|
||||
"libsql@npm:^0.4.4": "patch:libsql@npm%3A0.4.7#~/.yarn/patches/libsql-npm-0.4.7-444e260fb1.patch",
|
||||
"node-abi": "4.12.0",
|
||||
"node-abi": "4.24.0",
|
||||
"openai@npm:^4.77.0": "npm:@cherrystudio/openai@6.5.0",
|
||||
"openai@npm:^4.87.3": "npm:@cherrystudio/openai@6.5.0",
|
||||
"pdf-parse@npm:1.1.1": "patch:pdf-parse@npm%3A1.1.1#~/.yarn/patches/pdf-parse-npm-1.1.1-04a6109b2a.patch",
|
||||
|
||||
@ -375,13 +375,16 @@ export class WindowService {
|
||||
|
||||
mainWindow.hide()
|
||||
|
||||
// TODO: don't hide dock icon when close to tray
|
||||
// will cause the cmd+h behavior not working
|
||||
// after the electron fix the bug, we can restore this code
|
||||
// //for mac users, should hide dock icon if close to tray
|
||||
// if (isMac && isTrayOnClose) {
|
||||
// app.dock?.hide()
|
||||
// }
|
||||
//for mac users, should hide dock icon if close to tray
|
||||
if (isMac && isTrayOnClose) {
|
||||
app.dock?.hide()
|
||||
|
||||
mainWindow.once('show', () => {
|
||||
//restore the window can hide by cmd+h when the window is shown again
|
||||
// https://github.com/electron/electron/pull/47970
|
||||
app.dock?.show()
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
mainWindow.on('closed', () => {
|
||||
|
||||
18
yarn.lock
18
yarn.lock
@ -10088,7 +10088,7 @@ __metadata:
|
||||
dotenv-cli: "npm:^7.4.2"
|
||||
drizzle-kit: "npm:^0.31.4"
|
||||
drizzle-orm: "npm:^0.44.5"
|
||||
electron: "npm:38.4.0"
|
||||
electron: "npm:38.7.0"
|
||||
electron-builder: "npm:26.0.15"
|
||||
electron-devtools-installer: "npm:^3.2.0"
|
||||
electron-reload: "npm:^2.0.0-alpha.1"
|
||||
@ -13756,16 +13756,16 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"electron@npm:38.4.0":
|
||||
version: 38.4.0
|
||||
resolution: "electron@npm:38.4.0"
|
||||
"electron@npm:38.7.0":
|
||||
version: 38.7.0
|
||||
resolution: "electron@npm:38.7.0"
|
||||
dependencies:
|
||||
"@electron/get": "npm:^2.0.0"
|
||||
"@types/node": "npm:^22.7.7"
|
||||
extract-zip: "npm:^2.0.1"
|
||||
bin:
|
||||
electron: cli.js
|
||||
checksum: 10c0/3458409151d12f1fcd5e95374aa36e0d2f4aa0d3421c9f57dc521c606070294f33b24a681b3f93b49b02f4a3a07eb0070100ebda51b1198efd4b49dbf1260713
|
||||
checksum: 10c0/78a0917141b7a90253aff16e83b9683fb0facb098e8d9d5a71e7100b15fc3c00cd5d92e2ed3aba70067365022920293a7335ccfda5e8de1ef0d9a7d350e24c3c
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@ -19637,12 +19637,12 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"node-abi@npm:4.12.0":
|
||||
version: 4.12.0
|
||||
resolution: "node-abi@npm:4.12.0"
|
||||
"node-abi@npm:4.24.0":
|
||||
version: 4.24.0
|
||||
resolution: "node-abi@npm:4.24.0"
|
||||
dependencies:
|
||||
semver: "npm:^7.6.3"
|
||||
checksum: 10c0/78a0697b1ea7da95bee5465d92772a883fb829ae01e89cf2b60c2af79bf784e422cdde9cc2f15684d5bafb9a0ac3d8e16292520107dc36eff30c541e23ac9fb7
|
||||
checksum: 10c0/9bf9f4e79c875b98f8026f2ad80150b2d5077f48529444232c9574cfd82e45d42a3ab2dcf6fb374cf7775becbf58e7c1b8704596ad3bef27cdeab7bc93eca7a3
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user