mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-20 16:42:44 +02:00
Show an activity indicator whilst preparing the identity service. Show an alert when there's an error.
This commit is contained in:
@@ -3123,19 +3123,40 @@ TableViewSectionsDelegate>
|
||||
{
|
||||
MXWeakify(self);
|
||||
|
||||
// The preparation can take some time so indicate this to the user
|
||||
[self startActivityIndicator];
|
||||
|
||||
[session prepareIdentityServiceForTermsWithDefault:RiotSettings.shared.identityServerUrlString
|
||||
completion:^(MXSession *session, NSString *baseURL, NSString *accessToken) {
|
||||
success:^(MXSession *session, NSString *baseURL, NSString *accessToken) {
|
||||
MXStrongifyAndReturnIfNil(self);
|
||||
|
||||
[self stopActivityIndicator];
|
||||
|
||||
// Present the terms of the identity server.
|
||||
[self presentIdentityServerTermsWithSession:session baseURL:baseURL andAccessToken:accessToken];
|
||||
} failure:^(NSError *error) {
|
||||
MXStrongifyAndReturnIfNil(self);
|
||||
|
||||
[self stopActivityIndicator];
|
||||
|
||||
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:NSLocalizedStringFromTable(@"contacts_access_identity_service_error", @"Vector", nil)
|
||||
message:nil
|
||||
preferredStyle:UIAlertControllerStyleAlert];
|
||||
|
||||
[alertController addAction:[UIAlertAction actionWithTitle:[NSBundle mxk_localizedStringForKey:@"ok"]
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:nil]];
|
||||
|
||||
[self presentViewController:alertController animated:YES completion:nil];
|
||||
|
||||
[MXKAppSettings standardAppSettings].syncLocalContacts = NO;
|
||||
[self updateSections];
|
||||
}];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
[MXKAppSettings standardAppSettings].syncLocalContacts = NO;
|
||||
|
||||
[self updateSections];
|
||||
}
|
||||
}
|
||||
@@ -4547,11 +4568,13 @@ TableViewSectionsDelegate>
|
||||
[coordinatorBridgePresenter dismissWithAnimated:YES completion:^{
|
||||
|
||||
}];
|
||||
[self updateSections];
|
||||
self.serviceTermsModalCoordinatorBridgePresenter = nil;
|
||||
}
|
||||
|
||||
- (void)serviceTermsModalCoordinatorBridgePresenterDelegateDidClose:(ServiceTermsModalCoordinatorBridgePresenter * _Nonnull)coordinatorBridgePresenter
|
||||
{
|
||||
[self updateSections];
|
||||
self.serviceTermsModalCoordinatorBridgePresenter = nil;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user