Closed RianGallagher closed 5 years ago
I'll add this when I'm home from work :)
If you run npm update @osjs/client
and rebuild with npm run build
, you can now do the following when making a window:
.createWindow({
ondestroy: () => {
return false;
}
})
The return false
will block the destructor method. Any other value here is ignored and will make destruction work as usual.
Since I haven't head back, I'm closing this issue. If you run into any issues, feel free to re-open :)
@andersevenrud thanks for that, it works perfectly
Glad to hear it! :)
At the moment there is no way to stop window destruction from happening after the user has tried to close a window. I think this would be a useful feature to have.
An example use case could be creating a confirmation dialogue when someone tries to close a window and only triggering destruction when they confirm.