Skip to content

Commit eb5dce3

Browse files
author
Matthias Rütten
committed
show and hide the dock only when it's defined (e.g. linus don't has a dock)
1 parent 726d1ee commit eb5dce3

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/main/main.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,19 @@ const setup = async () => {
5555
const hideWindow = () => {
5656
if (win && win.isVisible()) {
5757
win.hide()
58-
app.dock.hide()
58+
if (app.dock) {
59+
app.dock.hide()
60+
}
5961
}
6062
}
6163

6264
const showWindow = () => {
6365
const position = getWindowPosition()
6466

6567
if (position && win) {
66-
app.dock.show()
68+
if (app.dock) {
69+
app.dock.show()
70+
}
6771

6872
// We have to wait a bit because the dock.show() is triggering a "window.hide" event
6973
// otherwise the app would be closed immediately
@@ -164,7 +168,9 @@ const createWindow = () => {
164168
})
165169
}
166170

167-
app.dock.hide()
171+
if (app.dock) {
172+
app.dock.hide()
173+
}
168174

169175
app.on('ready', setup)
170176

0 commit comments

Comments
 (0)