Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(electron): Check whether the splash screen is already destroyed on close #2044

Merged
merged 2 commits into from
Oct 17, 2019

Conversation

walkingriver
Copy link
Contributor

Resolves #2010 on MacOS.

The issue stems from the splash screen being destroyed already, so I'm simply adding a check to ensure that the splash screen reference has a value and that it isn't already destroyed. This seems to solve the problem in a straightforward manner.

Resolves ionic-team#2010 on MacOS. 

The issue stems from the splash screen being destroyed already, so I'm simply adding a check to ensure that the splash screen reference has a value and that it isn't already destroyed. This seems to solve the problem in a straightforward manner.
@@ -113,7 +113,9 @@ class CapacitorSplashScreen {
`;

this.mainWindowRef.on('closed', () => {
this.splashWindow.close();
if (this.splashWindow && !this.splashWindow.isDestroyed) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isDestroyed is a function, not a property. This condition will always return false.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed with latest commit. Thanks, @benjcallaghan!

Responding to the code review, fixed the call to `isDestroyed()` instead of `isDestroyed`.
Copy link
Member

@jcesarmobile jcesarmobile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks!

@jcesarmobile jcesarmobile changed the title Fix(Electron/MacOS) Check whether the splash screen is already destroyed fix(electron): Check whether the splash screen is already destroyed on close Oct 17, 2019
@jcesarmobile jcesarmobile merged commit 455c6e9 into ionic-team:master Oct 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Splash Screen is destroyed on macOS
3 participants