Security screens: Update automatically shields when the trust changes.

This commit is contained in:
manuroe
2020-10-08 17:34:42 +02:00
parent c1d3613a66
commit 6131de3077
3 changed files with 80 additions and 1 deletions

View File

@@ -114,6 +114,8 @@ enum {
}];
[self userInterfaceThemeDidChange];
[self registerDeviceChangesNotification];
}
- (void)userInterfaceThemeDidChange
@@ -247,6 +249,29 @@ enum {
}
#pragma mark - Data update
- (void)registerDeviceChangesNotification
{
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(onDeviceInfoTrustLevelDidChangeNotification:)
name:MXDeviceInfoTrustLevelDidChangeNotification
object:nil];
}
- (void)onDeviceInfoTrustLevelDidChangeNotification:(NSNotification*)notification
{
MXDeviceInfo *deviceInfo = notification.object;
NSString *deviceId = deviceInfo.deviceId;
if ([deviceId isEqualToString:device.deviceId])
{
[self reloadDeviceWithCompletion:^{
}];
}
}
#pragma mark - Segues
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender