Last active
May 9, 2022 18:46
-
-
Save t4t5/169727139514a81c603646a7de2044b4 to your computer and use it in GitHub Desktop.
Electron: Hide window instead of quitting when closing it
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Hide window instead of quitting when closing it: | |
win = new BrowserWindow({ width: 500, height: 500 }) | |
win.on('close', e => { | |
e.preventDefault() // Prevents quit | |
win.hide() | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment