mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-20 16:42:44 +02:00
MESSENGER-3539 prevent logout and error popup when logging out
This commit is contained in:
@@ -47,6 +47,8 @@
|
||||
|
||||
NSString* const kSettingsViewControllerPhoneBookCountryCellId = @"kSettingsViewControllerPhoneBookCountryCellId";
|
||||
|
||||
NSString *const BWISettingsErrorDomain = @"BWISettingsErrorDomain";
|
||||
|
||||
typedef NS_ENUM(NSUInteger, SECTION_TAG)
|
||||
{
|
||||
SECTION_TAG_SIGN_OUT = 0,
|
||||
@@ -3452,13 +3454,24 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
|
||||
|
||||
- (void)onSignout:(id)sender
|
||||
{
|
||||
self.signOutButton = (UIButton*)sender;
|
||||
|
||||
SignOutFlowPresenter *flowPresenter = [[SignOutFlowPresenter alloc] initWithSession:self.mainSession presentingViewController:self];
|
||||
flowPresenter.delegate = self;
|
||||
|
||||
[flowPresenter startWithSourceView:self.signOutButton];
|
||||
self.signOutFlowPresenter = flowPresenter;
|
||||
// bwi (#3539) Check connectivity before login out. Logout can have strange effects when occuring without network connection
|
||||
if ([AppDelegate theDelegate].isOffline)
|
||||
{
|
||||
NSError *error = [NSError errorWithDomain:BWISettingsErrorDomain
|
||||
code:BWISettingsOfflineLogoutErrorCode
|
||||
userInfo:@{
|
||||
NSLocalizedDescriptionKey : BWIL10n.bwiErrorLogoutOffline
|
||||
}];
|
||||
[[AppDelegate theDelegate] showErrorAsAlert:error];
|
||||
} else {
|
||||
self.signOutButton = (UIButton*)sender;
|
||||
|
||||
SignOutFlowPresenter *flowPresenter = [[SignOutFlowPresenter alloc] initWithSession:self.mainSession presentingViewController:self];
|
||||
flowPresenter.delegate = self;
|
||||
|
||||
[flowPresenter startWithSourceView:self.signOutButton];
|
||||
self.signOutFlowPresenter = flowPresenter;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)onRemove3PID:(NSIndexPath*)indexPath
|
||||
|
||||
Reference in New Issue
Block a user