The problem was that by re-adding the window frame on Windows, the window could be closed for good (i.e. not just hidden) and then when trying to re-open it via the systray, the corresponding BrowserWindow object would not exist anymore.
This PR solves that problem in that it intercepts the 'close' event of the main window and only actually closes it if either launcher has not fully launched yet (e.g. still on the password screen), in which case it will also close the settings window to get the 'window-all-closed' event triggered and quit the app fully, or the app is quitting. Otherwise, the window will only be hidden instead of closed.
This PR addresses https://github.com/holochain/launcher/issues/170
The problem was that by re-adding the window frame on Windows, the window could be closed for good (i.e. not just hidden) and then when trying to re-open it via the systray, the corresponding BrowserWindow object would not exist anymore.
This PR solves that problem in that it intercepts the 'close' event of the main window and only actually closes it if either launcher has not fully launched yet (e.g. still on the password screen), in which case it will also close the settings window to get the 'window-all-closed' event triggered and quit the app fully, or the app is quitting. Otherwise, the window will only be hidden instead of closed.