Skip to content

Commit 01ce1b3

Browse files
Fix active chats row insertion crash once and for all (hopefully)
1 parent 8e2b21a commit 01ce1b3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Monal/Classes/ActiveChatsViewController.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,8 +613,11 @@ -(void) insertOrMoveContact:(MLContact*) contact completion:(void (^ _Nullable)(
613613
[insertContactToArray insertObject:contact atIndex:0];
614614
[self.chatListTable insertRowsAtIndexPaths:@[insertAtPath] withRowAnimation:UITableViewRowAnimationRight];
615615
//make sure to fully refresh to remove the empty dataset (yes this will trigger on first chat pinning, too, but that does no harm)
616+
//but make sure to not do this nested inside our current performBatchUpdates call!
616617
if(oldCount == 0)
617-
[self refreshDisplay];
618+
dispatch_async(dispatch_get_main_queue(), ^{
619+
[self refreshDisplay];
620+
});
618621
}
619622
} completion:^(BOOL finished) {
620623
if(completion) completion(finished);

0 commit comments

Comments
 (0)