Close windows instead of destroying them
This commit is contained in:
parent
cce6be1900
commit
0ebe142b2f
10 changed files with 45 additions and 62 deletions
13
spec/window-helpers.js
Normal file
13
spec/window-helpers.js
Normal file
|
@ -0,0 +1,13 @@
|
|||
exports.closeWindow = (window) => {
|
||||
if (window == null || window.isDestroyed()) {
|
||||
return Promise.resolve()
|
||||
} else {
|
||||
return new Promise((resolve, reject) => {
|
||||
window.once('closed', () => {
|
||||
resolve()
|
||||
})
|
||||
window.setClosable(true)
|
||||
window.close()
|
||||
})
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue