Merge pull request #2697 from vector-im/riot_2665

Settings: Update the screen if IS is changed from another device
This commit is contained in:
manuroe
2019-09-05 15:31:59 +02:00
committed by GitHub
2 changed files with 17 additions and 2 deletions
@@ -417,7 +417,7 @@
NSLog(@"[ForgotPasswordInputsView] checkIdentityServerRequirement: %@", matrixVersions.doesServerRequireIdentityServerParam ? @"YES": @"NO");
if (matrixVersions.doesServerRequireIdentityServerParam
&& !mxRestClient.credentials.identityServer)
&& !mxRestClient.identityServer)
{
failure([NSError errorWithDomain:MXKAuthErrorDomain
code:0
+16 -1
View File
@@ -322,6 +322,8 @@ SingleImagePickerPresenterDelegate>
[self refreshSettings];
}];
[self registerAccountDataDidChangeIdentityServerNotification];
// Add each matrix session, to update the view controller appearance according to mx sessions state
NSArray *sessions = [AppDelegate theDelegate].mxSessions;
@@ -3775,7 +3777,7 @@ SingleImagePickerPresenterDelegate>
NSLog(@"[SettingsViewController] checkIdentityServerRequirement: %@", matrixVersions.doesServerRequireIdentityServerParam ? @"YES": @"NO");
if (matrixVersions.doesServerRequireIdentityServerParam
&& !mxRestClient.credentials.identityServer)
&& !mxRestClient.identityServer)
{
NSString *message;
if ([medium isEqualToString:kMX3PIDMediumMSISDN])
@@ -4537,4 +4539,17 @@ SingleImagePickerPresenterDelegate>
[self.tableView reloadData];
}
#pragma mark - Identity Server updates
- (void)registerAccountDataDidChangeIdentityServerNotification
{
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleAccountDataDidChangeIdentityServerNotification:) name:kMXSessionAccountDataDidChangeIdentityServerNotification object:nil];
}
- (void)handleAccountDataDidChangeIdentityServerNotification:(NSNotification*)notification
{
[self refreshSettings];
}
@end