2
0

Fix sign-out.

[FIXED]     MP-13: Sign Out doesn't work -- when password is saved,
            signing out signs you right back in.  Now, the saved key
            password is forgotten.
This commit is contained in:
Maarten Billemont 2012-05-12 00:08:19 +02:00
parent 82b8de5e23
commit cdfafa55cf
2 changed files with 20 additions and 12 deletions

View File

@ -114,6 +114,25 @@
[self.window.rootViewController presentModalViewController:composer animated:YES];
}
#pragma mark - PearlConfigDelegate
- (void)didUpdateConfigForKey:(SEL)configKey fromValue:(id)value {
[self checkConfig];
}
- (void)checkConfig {
if ([[MPConfig get].saveKey boolValue]) {
if (self.key)
[self updateKey:self.key];
} else
[self loadStoredKey];
if ([[MPConfig get].iCloud boolValue] != [self.storeManager iCloudEnabled])
[self.storeManager useiCloudStore:[[MPConfig get].iCloud boolValue] alertUser:YES];
}
#pragma mark - UIApplicationDelegate
@ -367,18 +386,6 @@
[TestFlight passCheckpoint:MPTestFlightCheckpointDeactivated];
}
- (void)checkConfig {
if ([[MPConfig get].saveKey boolValue]) {
if (self.key)
[self updateKey:self.key];
} else
[self loadStoredKey];
if ([[MPConfig get].iCloud boolValue] != [self.storeManager iCloudEnabled])
[self.storeManager useiCloudStore:[[MPConfig get].iCloud boolValue] alertUser:YES];
}
#pragma mark - MFMailComposeViewControllerDelegate
- (void)mailComposeController:(MFMailComposeViewController *)controller

View File

@ -434,6 +434,7 @@
#endif
#endif
{
[MPConfig get].saveKey = [NSNumber numberWithBool:NO];
[[MPAppDelegate get] signOut:self];
[[MPAppDelegate get] loadKey:YES];
break;