| Index: ios/chrome/browser/ui/reading_list/reading_list_side_swipe_provider.mm
|
| diff --git a/ios/chrome/browser/ui/reading_list/reading_list_side_swipe_provider.mm b/ios/chrome/browser/ui/reading_list/reading_list_side_swipe_provider.mm
|
| index 7000f2a38125580f869ad22f99a57abef95fd6f5..a3b42901a6acae94dc0a5e42252fd66342b10c2e 100644
|
| --- a/ios/chrome/browser/ui/reading_list/reading_list_side_swipe_provider.mm
|
| +++ b/ios/chrome/browser/ui/reading_list/reading_list_side_swipe_provider.mm
|
| @@ -8,6 +8,7 @@
|
| #include "components/reading_list/ios/reading_list_entry.h"
|
| #include "components/reading_list/ios/reading_list_model.h"
|
| #include "ios/web/public/web_state/web_state.h"
|
| +#include "net/base/network_change_notifier.h"
|
| #include "url/gurl.h"
|
|
|
| #if !defined(__has_feature) || !__has_feature(objc_arc)
|
| @@ -55,16 +56,8 @@ class ReadingListObserverBridge;
|
| if (!webState || _readingListModel->unread_size() == 0) {
|
| return;
|
| }
|
| - int64_t updateTime = 0;
|
| - const ReadingListEntry* firstEntry = nullptr;
|
| - for (const auto& url : _readingListModel->Keys()) {
|
| - const ReadingListEntry* entry = _readingListModel->GetEntryByURL(url);
|
| - if (!entry->IsRead() && entry->UpdateTime() > updateTime) {
|
| - updateTime = entry->UpdateTime();
|
| - firstEntry = entry;
|
| - }
|
| - }
|
| - DCHECK_GT(updateTime, 0);
|
| + const ReadingListEntry* firstEntry = _readingListModel->GetFirstUnreadEntry(
|
| + net::NetworkChangeNotifier::IsOffline());
|
| DCHECK(firstEntry);
|
| web::NavigationManager::WebLoadParams params(firstEntry->URL());
|
| params.transition_type = ui::PageTransition::PAGE_TRANSITION_AUTO_BOOKMARK;
|
|
|