Chromium Code Reviews| Index: components/ntp_snippets/remote/ntp_snippets_service.cc |
| diff --git a/components/ntp_snippets/remote/ntp_snippets_service.cc b/components/ntp_snippets/remote/ntp_snippets_service.cc |
| index 8314a0783615a34d54849c57d924c9a879f0e0d0..63b79593e1d0730564daea882de936a42c83adc5 100644 |
| --- a/components/ntp_snippets/remote/ntp_snippets_service.cc |
| +++ b/components/ntp_snippets/remote/ntp_snippets_service.cc |
| @@ -314,8 +314,8 @@ CategoryInfo NTPSnippetsService::GetCategoryInfo(Category category) { |
| const CategoryContent& content = categories_[category]; |
| return CategoryInfo(content.localized_title, |
| ContentSuggestionsCardLayout::FULL_CARD, |
| - /* has_more_button */ false, |
| - /* show_if_empty */ true); |
| + /*has_more_button=*/false, |
| + /*show_if_empty=*/true); |
| } |
| void NTPSnippetsService::DismissSuggestion( |
| @@ -836,11 +836,13 @@ void NTPSnippetsService::EnterStateReady() { |
| fetch_when_ready_ = false; |
| } |
| - // FetchSnippets should set the status to |AVAILABLE_LOADING| if relevant, |
| - // otherwise we transition to |AVAILABLE| here. |
| - if (categories_[articles_category_].status != |
| - CategoryStatus::AVAILABLE_LOADING) { |
| - UpdateCategoryStatus(articles_category_, CategoryStatus::AVAILABLE); |
| + for (const auto& item : categories_) { |
|
Marc Treib
2016/10/14 13:47:14
This was the actual problem - I missed updating on
|
| + Category category = item.first; |
| + const CategoryContent& content = item.second; |
| + // FetchSnippets has set the status to |AVAILABLE_LOADING| if relevant, |
| + // otherwise we transition to |AVAILABLE| here. |
| + if (content.status != CategoryStatus::AVAILABLE_LOADING) |
| + UpdateCategoryStatus(category, CategoryStatus::AVAILABLE); |
| } |
| } |