diff --git a/MasterPassword/iOS/MPAppDelegate.m b/MasterPassword/iOS/MPAppDelegate.m index 452ca670..3b5d446b 100644 --- a/MasterPassword/iOS/MPAppDelegate.m +++ b/MasterPassword/iOS/MPAppDelegate.m @@ -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 diff --git a/MasterPassword/iOS/MPMainViewController.m b/MasterPassword/iOS/MPMainViewController.m index 60d70c28..1f48043f 100644 --- a/MasterPassword/iOS/MPMainViewController.m +++ b/MasterPassword/iOS/MPMainViewController.m @@ -434,6 +434,7 @@ #endif #endif { + [MPConfig get].saveKey = [NSNumber numberWithBool:NO]; [[MPAppDelegate get] signOut:self]; [[MPAppDelegate get] loadKey:YES]; break;