Skip to content

Commit

Permalink
fixes a bug that crashed the app when a remote push notification abou…
Browse files Browse the repository at this point in the history
…t channel updates arrives
  • Loading branch information
Frank Gregor committed Feb 7, 2020
1 parent 733035b commit 5dccd89
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions App/Podlive/Channel Grid/CCNChannelGridViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -266,15 +266,8 @@ - (void)handlePushNotificationChannelStateUpdated:(NSNotification *)note {
[ctx invalidateSupplementaryElementsOfKind:CCNCollectionElementKindItemDetail atIndexPaths:indexPaths];
[layout invalidateLayoutWithContext:ctx];

[self.collectionView.animator performBatchUpdates:^{
@strongify(self);
[self.collectionView moveItemAtIndexPath:channelIndexPathOld toIndexPath:channelIndexPathNew];
[self.collectionView reloadSections:[NSIndexSet indexSetWithIndex:0]];

} completionHandler:^(BOOL finished) {
@strongify(self);
[self updateHeaderViews];
}];
[self.collectionView.animator moveItemAtIndexPath:channelIndexPathOld toIndexPath:channelIndexPathNew];
[self updateHeaderViews];
};

dispatch_async(dispatch_get_main_queue(), ^{
Expand Down

0 comments on commit 5dccd89

Please sign in to comment.