Fix white screen bug / Remove window flicker when starting hidden / Add "start automatically" setting #95
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In this commit we make the following changes:
Fix "White Screen of Death"
An issue that many users experience is that after an indeterminate period of time, the main application window becomes a blank white screen. When this happens, the application stops functioning because there is no content to be checked for new notifications anymore. As far as we can tell, this is a bug in Electron, not a bug in this application or Google Voice. To work around this issue, we update our "check for new notifications" interval to be every 3 seconds instead of 1 and add an extra check to see whether the content of the window has become "blank" (the white screen of death). When we detect this state, we automatically reload Google Voice. Since the application is already broken once we detect this state, forcing a reload should have no adverse effect (data loss, for example).
Remove window flicker when starting hidden
Currently, when the "start minimized" setting is enabled, the main application window flickers on screen briefly before it gets hidden. We fix this by reversing our window creation logic. We make the window hidden initially, and then show it only if the "start minimized" setting hasn't been turned on (it's always off by default).
Add "start automatically" setting
Finally, as a companion change to the fixing of the "white screen of death" bug, we make one additional change that hopefully finalizes the user's ability to never miss a notification when using this application. In the settings dialog, we add a new "Start automatically at logon" setting.