mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-25 19:10:49 +02:00
Settings: More cleaning
This commit is contained in:
@@ -136,7 +136,7 @@ MXKEncryptionInfoViewDelegate>
|
||||
|
||||
if (self.tableView.dataSource)
|
||||
{
|
||||
[self refreshSettings];
|
||||
[self reloadData];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -190,7 +190,7 @@ MXKEncryptionInfoViewDelegate>
|
||||
[self releasePushedViewController];
|
||||
|
||||
// Refresh display
|
||||
[self refreshSettings];
|
||||
[self reloadData];
|
||||
|
||||
// Observe kAppDelegateDidTapStatusBarNotificationObserver.
|
||||
kAppDelegateDidTapStatusBarNotificationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:kAppDelegateDidTapStatusBarNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notif) {
|
||||
@@ -266,7 +266,7 @@ MXKEncryptionInfoViewDelegate>
|
||||
}
|
||||
}
|
||||
|
||||
- (void)refreshSettings
|
||||
- (void)reloadData
|
||||
{
|
||||
// Trigger a full table reloadData
|
||||
[self.tableView reloadData];
|
||||
@@ -279,53 +279,16 @@ MXKEncryptionInfoViewDelegate>
|
||||
MXStrongifyAndReturnIfNil(self);
|
||||
|
||||
self->device = device;
|
||||
[self refreshSettings];
|
||||
[self reloadData];
|
||||
completion();
|
||||
|
||||
} failure:^(NSError *error) {
|
||||
NSLog(@"[ManageSessionVC] reloadDeviceWithCompletion failed. Error: %@", error);
|
||||
[self refreshSettings];
|
||||
[self reloadData];
|
||||
completion();
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)requestAccountPasswordWithTitle:(NSString*)title message:(NSString*)message onComplete:(void (^)(NSString *password))onComplete
|
||||
{
|
||||
[currentAlert dismissViewControllerAnimated:NO completion:nil];
|
||||
|
||||
// Prompt the user before deleting the device.
|
||||
currentAlert = [UIAlertController alertControllerWithTitle:title
|
||||
message:message
|
||||
preferredStyle:UIAlertControllerStyleAlert];
|
||||
|
||||
[currentAlert addTextFieldWithConfigurationHandler:^(UITextField *textField) {
|
||||
textField.secureTextEntry = YES;
|
||||
textField.placeholder = nil;
|
||||
textField.keyboardType = UIKeyboardTypeDefault;
|
||||
}];
|
||||
|
||||
MXWeakify(self);
|
||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[NSBundle mxk_localizedStringForKey:@"cancel"]
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction * action)
|
||||
{
|
||||
MXStrongifyAndReturnIfNil(self);
|
||||
self->currentAlert = nil;
|
||||
}]];
|
||||
|
||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[NSBundle mxk_localizedStringForKey:@"continue"]
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction * action) {
|
||||
MXStrongifyAndReturnIfNil(self);
|
||||
|
||||
UITextField *textField = [self->currentAlert textFields].firstObject;
|
||||
self->currentAlert = nil;
|
||||
|
||||
onComplete(textField.text);
|
||||
}]];
|
||||
|
||||
[self presentViewController:currentAlert animated:YES completion:nil];
|
||||
}
|
||||
|
||||
#pragma mark - Segues
|
||||
|
||||
@@ -696,7 +659,7 @@ MXKEncryptionInfoViewDelegate>
|
||||
|
||||
// Hot change
|
||||
self->device.displayName = text;
|
||||
[self refreshSettings];
|
||||
[self reloadData];
|
||||
[self.activityIndicator startAnimating];
|
||||
|
||||
[self.mainSession.matrixRestClient setDeviceName:text forDeviceId:self->device.deviceId success:^{
|
||||
@@ -820,7 +783,7 @@ MXKEncryptionInfoViewDelegate>
|
||||
- (void)dataSource:(MXKDataSource *)dataSource didCellChange:(id)changes
|
||||
{
|
||||
// Group data has been updated. Do a simple full reload
|
||||
[self refreshSettings];
|
||||
[self reloadData];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -165,7 +165,7 @@ UIDocumentInteractionControllerDelegate>
|
||||
|
||||
if (self.tableView.dataSource)
|
||||
{
|
||||
[self refreshSettings];
|
||||
[self reloadData];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -229,7 +229,7 @@ UIDocumentInteractionControllerDelegate>
|
||||
[self releasePushedViewController];
|
||||
|
||||
// Refresh display
|
||||
[self refreshSettings];
|
||||
[self reloadData];
|
||||
|
||||
// Refresh the current device information in parallel
|
||||
[self loadCurrentDeviceInformation];
|
||||
@@ -313,7 +313,7 @@ UIDocumentInteractionControllerDelegate>
|
||||
|
||||
// Refresh all the table (A slide down animation is observed when we limit the refresh to the concerned section).
|
||||
// Note: The use of 'reloadData' handles the case where the account has been logged out.
|
||||
[self refreshSettings];
|
||||
[self reloadData];
|
||||
|
||||
} failure:nil];
|
||||
}
|
||||
@@ -432,18 +432,18 @@ UIDocumentInteractionControllerDelegate>
|
||||
|
||||
// Refresh all the table (A slide down animation is observed when we limit the refresh to the concerned section).
|
||||
// Note: The use of 'reloadData' handles the case where the account has been logged out.
|
||||
[self refreshSettings];
|
||||
[self reloadData];
|
||||
|
||||
} failure:^(NSError *error) {
|
||||
|
||||
// Display the data that has been loaded last time
|
||||
// Note: The use of 'reloadData' handles the case where the account has been logged out.
|
||||
[self refreshSettings];
|
||||
[self reloadData];
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)refreshSettings
|
||||
- (void)reloadData
|
||||
{
|
||||
// Trigger a full table reloadData
|
||||
[self.tableView reloadData];
|
||||
@@ -897,7 +897,7 @@ UIDocumentInteractionControllerDelegate>
|
||||
- (void)dataSource:(MXKDataSource *)dataSource didCellChange:(id)changes
|
||||
{
|
||||
// Group data has been updated. Do a simple full reload
|
||||
[self refreshSettings];
|
||||
[self reloadData];
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user