Skip to content

Commit

Permalink
Fix for preview image being stuck after leaving app rapidly on splash.
Browse files Browse the repository at this point in the history
  • Loading branch information
MobilityTiago committed Aug 4, 2017
1 parent 20c451b commit 195a89a
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/ios/PrivacyScreenPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ - (void) onPageDidLoad
- (void)onAppDidBecomeActive:(UIApplication *)application
{
//[self.privacyTimer invalidate];
if(!self.privacyTimer)
if(!self.privacyTimer || !self.privacyTimer.valid)
self.privacyTimer = [NSTimer scheduledTimerWithTimeInterval:self.privacyTimerInterval
target:self
selector:@selector(removePrivacyScreen)
Expand All @@ -113,11 +113,9 @@ - (void)onAppWillResignActive:(UIApplication *)application
#pragma mark - Helper functions
-(void) removePrivacyScreen
{
if (imageView == NULL)
{
self.viewController.view.window.hidden = NO;
}
else
self.viewController.view.window.hidden = NO;

if (imageView != NULL)
{
[UIView animateWithDuration:0.1f
animations:^{
Expand All @@ -128,7 +126,7 @@ -(void) removePrivacyScreen
}];
}

if(self.privacyTimer)
if(self.privacyTimer || self.privacyTimer.valid)
{
[self.privacyTimer invalidate];
self.privacyTimer = nil;
Expand Down

0 comments on commit 195a89a

Please sign in to comment.