Skip to content

Commit bf41847

Browse files
nguyenhuymaicki
authored andcommitted
Don't load collection/table node just to wait for updates to be committed (facebookarchive#3182)
- Because there would be no update otherwise.
1 parent e6ee24d commit bf41847

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

Source/ASCollectionNode.mm

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,10 @@ - (void)performBatchUpdates:(void (^)())updates completion:(void (^)(BOOL))compl
519519

520520
- (void)waitUntilAllUpdatesAreCommitted
521521
{
522-
[self.view waitUntilAllUpdatesAreCommitted];
522+
ASDisplayNodeAssertMainThread();
523+
if (self.nodeLoaded) {
524+
[self.view waitUntilAllUpdatesAreCommitted];
525+
}
523526
}
524527

525528
- (void)reloadDataWithCompletion:(void (^)())completion

Source/ASTableNode.mm

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,10 @@ - (void)moveRowAtIndexPath:(NSIndexPath *)indexPath toIndexPath:(NSIndexPath *)n
653653

654654
- (void)waitUntilAllUpdatesAreCommitted
655655
{
656-
[self.view waitUntilAllUpdatesAreCommitted];
656+
ASDisplayNodeAssertMainThread();
657+
if (self.nodeLoaded) {
658+
[self.view waitUntilAllUpdatesAreCommitted];
659+
}
657660
}
658661

659662
#pragma mark - Debugging (Private)

0 commit comments

Comments
 (0)