From 50983e8fa5dc90dfd6d8bff5855c7d6c33f3037e Mon Sep 17 00:00:00 2001 From: Brieuc Viel Date: Wed, 6 Dec 2017 11:40:35 +0100 Subject: [PATCH] [CNContact] fiix checkbox display on contactList --- Classes/ContactsListTableView.m | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/Classes/ContactsListTableView.m b/Classes/ContactsListTableView.m index f3a86337c..40f8e7b3e 100644 --- a/Classes/ContactsListTableView.m +++ b/Classes/ContactsListTableView.m @@ -192,10 +192,7 @@ static int ms_strcmpfuz(const char *fuzzy_word, const char *sentence) { [subAr insertObject:contact atIndex:idx]; } } - //} } - [super loadData]; - // since we refresh the tableview, we must perform this on main // thread dispatch_async(dispatch_get_main_queue(), ^(void) { @@ -209,6 +206,7 @@ static int ms_strcmpfuz(const char *fuzzy_word, const char *sentence) { } [LinphoneManager.instance setLinphoneManagerAddressBookMap:addressBookMap]; } + [super loadData]; _ongoing = FALSE; } @@ -406,23 +404,15 @@ static int ms_strcmpfuz(const char *fuzzy_word, const char *sentence) { } UIContactCell* cell = [self.tableView cellForRowAtIndexPath:indexPath]; [cell setContact:NULL]; - [[LinphoneManager.instance fastAddressBook] - deleteContact:contact]; - [tableView - deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] - withRowAnimation:UITableViewRowAnimationFade]; - [tableView endUpdates]; + [[LinphoneManager.instance fastAddressBook] deleteContact:contact]; + [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade]; + [tableView endUpdates]; - [NSNotificationCenter.defaultCenter - addObserver:self - selector:@selector(onAddressBookUpdate:) + [NSNotificationCenter.defaultCenter addObserver:self selector:@selector(onAddressBookUpdate:) name:kLinphoneAddressBookUpdate object:nil]; - dispatch_async(dispatch_get_main_queue(), - ^{ - [self loadData]; - }); - } + [self loadData]; + } } - (void)removeSelectionUsing:(void (^)(NSIndexPath *))remover { @@ -438,10 +428,9 @@ static int ms_strcmpfuz(const char *fuzzy_word, const char *sentence) { } UIContactCell* cell = [self.tableView cellForRowAtIndexPath:indexPath]; [cell setContact:NULL]; - [[LinphoneManager.instance fastAddressBook] deleteContact:contact]; + [[LinphoneManager.instance fastAddressBook] deleteContact:contact]; - [NSNotificationCenter.defaultCenter - addObserver:self + [NSNotificationCenter.defaultCenter addObserver:self selector:@selector(onAddressBookUpdate:) name:kLinphoneAddressBookUpdate object:nil];