electron/spec/window-helpers.js
2016-08-03 16:23:39 -07:00

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()
})
}
}