13 lines
298 B
JavaScript
13 lines
298 B
JavaScript
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()
|
|
})
|
|
}
|
|
}
|