| Index: ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.mm
|
| diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.mm b/ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.mm
|
| index fc6137156993d22a183cf6da93908d76f00d19f6..a7a7fa67509c183e6d292b84ffcb9a7747f344db 100644
|
| --- a/ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.mm
|
| +++ b/ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.mm
|
| @@ -89,6 +89,26 @@ const NSTimeInterval kAnimationDuration = 0.35;
|
| }];
|
| }
|
|
|
| +- (void)addSuggestions:(NSArray<ContentSuggestion*>*)suggestions {
|
| + if (suggestions.count == 0) {
|
| + return;
|
| + }
|
| +
|
| + [self.collectionView performBatchUpdates:^{
|
| + NSIndexSet* addedSections =
|
| + [self.collectionUpdater addSectionsForSuggestionsToModel:suggestions];
|
| + [self.collectionView insertSections:addedSections];
|
| + }
|
| + completion:nil];
|
| +
|
| + [self.collectionView performBatchUpdates:^{
|
| + NSArray<NSIndexPath*>* addedItems =
|
| + [self.collectionUpdater addSuggestionsToModel:suggestions];
|
| + [self.collectionView insertItemsAtIndexPaths:addedItems];
|
| + }
|
| + completion:nil];
|
| +}
|
| +
|
| #pragma mark - UIViewController
|
|
|
| - (void)viewDidLoad {
|
|
|