diff --git a/AutoPkgr/Models/Email & Notifications/LGEmailNotification.m b/AutoPkgr/Models/Email & Notifications/LGEmailNotification.m index 9681ae9a..23e2f1d8 100644 --- a/AutoPkgr/Models/Email & Notifications/LGEmailNotification.m +++ b/AutoPkgr/Models/Email & Notifications/LGEmailNotification.m @@ -47,7 +47,7 @@ + (BOOL)isEnabled + (BOOL)storesInfoInKeychain { - return YES; + return [[LGDefaults standardUserDefaults] SMTPAuthenticationEnabled]; } + (NSString *)account diff --git a/AutoPkgr/Views-Controllers-XIB/Tab Views/LGNotificationsViewController.m b/AutoPkgr/Views-Controllers-XIB/Tab Views/LGNotificationsViewController.m index 22273de3..1b79d14d 100644 --- a/AutoPkgr/Views-Controllers-XIB/Tab Views/LGNotificationsViewController.m +++ b/AutoPkgr/Views-Controllers-XIB/Tab Views/LGNotificationsViewController.m @@ -187,7 +187,7 @@ - (void)savePassword:(void (^)(NSError *error))reply NSString *account = _smtpUsername.safe_stringValue; NSString *password = _smtpPassword.safe_stringValue; - if (account) { + if (account && [LGEmailNotification storesInfoInKeychain]) { [LGEmailNotification saveInfoToKeychain:password reply:^(NSError *error) { if (reply) { reply(error); @@ -206,6 +206,10 @@ - (void)savePassword:(void (^)(NSError *error))reply } } }]; + } else { + if(reply){ + reply(nil); + } } }