2
0

Lock when backgrounded.

[FIXED]     When backgrounding the app and re-showing it, don't reveal
            the UI when logout is enabled.
This commit is contained in:
Maarten Billemont
2012-06-28 00:00:41 +02:00
parent d77cde1929
commit 110f7069e1
6 changed files with 56 additions and 25 deletions

View File

@@ -11,7 +11,7 @@
@interface MPAppDelegate_Shared (Key)
- (BOOL)signInAsUser:(MPUserEntity *)user usingMasterPassword:(NSString *)password;
- (void)signOut;
- (void)signOutAnimated:(BOOL)animated;
- (void)storeSavedKeyFor:(MPUserEntity *)user;
- (void)forgetSavedKeyFor:(MPUserEntity *)user;

View File

@@ -73,14 +73,15 @@ static NSDictionary *keyQuery(MPUserEntity *user) {
}
}
- (void)signOut {
- (void)signOutAnimated:(BOOL)animated {
if (self.key)
self.key = nil;
if (self.activeUser) {
self.activeUser = nil;
[[NSNotificationCenter defaultCenter] postNotificationName:MPNotificationSignedOut object:self];
[[NSNotificationCenter defaultCenter] postNotificationName:MPNotificationSignedOut object:self userInfo:
[NSDictionary dictionaryWithObject:PearlBool(animated) forKey:@"animated"]];
}
}

View File

@@ -182,7 +182,11 @@
[[NSNotificationCenter defaultCenter] addObserverForName:MPNotificationSignedOut object:nil queue:nil
usingBlock:^(NSNotification *note) {
[self.navigationController performSegueWithIdentifier:@"MP_Unlock" sender:nil];
if ([[note.userInfo objectForKey:@"animated"] boolValue])
[self.navigationController performSegueWithIdentifier:@"MP_Unlock" sender:nil];
else
[self.navigationController presentViewController:[self.navigationController.storyboard instantiateViewControllerWithIdentifier:@"MPUnlockViewController"]
animated:NO completion:nil];
}];
[[NSNotificationCenter defaultCenter] addObserverForName:kIASKAppSettingChanged object:nil queue:nil
usingBlock:^(NSNotification *note) {
@@ -325,7 +329,7 @@
[self saveContext];
if (![[MPiOSConfig get].rememberLogin boolValue])
[self signOut];
[self signOutAnimated:NO];
[TestFlight passCheckpoint:MPCheckpointDeactivated];
}
@@ -487,7 +491,7 @@
inf(@"Unsetting master password for: %@.", user.userID);
user.keyID = nil;
[self forgetSavedKeyFor:user];
[self signOut];
[self signOutAnimated:YES];
[TestFlight passCheckpoint:MPCheckpointChangeMP];
[[LocalyticsSession sharedLocalyticsSession] tagEvent:MPCheckpointChangeMP

View File

@@ -512,7 +512,7 @@
#endif
{
inf(@"Action: Sign out");
[[MPAppDelegate get] signOut];
[[MPAppDelegate get] signOutAnimated:YES];
break;
}
}