Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(103)

Unified Diff: ios/chrome/browser/ui/reading_list/reading_list_view_controller.mm

Issue 2609023002: Check editing status before doing actions. (Closed)
Patch Set: Created 3 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/ui/reading_list/reading_list_view_controller.mm
diff --git a/ios/chrome/browser/ui/reading_list/reading_list_view_controller.mm b/ios/chrome/browser/ui/reading_list/reading_list_view_controller.mm
index fbcced47cec036f4f16849756df1681664791cfa..781cfd2077297101e62faf688f88f72baef131a9 100644
--- a/ios/chrome/browser/ui/reading_list/reading_list_view_controller.mm
+++ b/ios/chrome/browser/ui/reading_list/reading_list_view_controller.mm
@@ -438,6 +438,9 @@ using ItemsMapByDate = std::multimap<int64_t, ReadingListCollectionViewItem*>;
}
- (void)donePressed {
+ if ([self.editor isEditing]) {
+ [self exitEditingModeAnimated:NO];
+ }
[self dismiss];
}
@@ -539,6 +542,9 @@ using ItemsMapByDate = std::multimap<int64_t, ReadingListCollectionViewItem*>;
#pragma mark - ReadingListToolbarDelegate
- (void)markPressed {
+ if (![self.editor isEditing]) {
+ return;
+ }
switch ([_toolbar state]) {
case NoneSelected:
[self markAllItemsAs];
@@ -556,6 +562,9 @@ using ItemsMapByDate = std::multimap<int64_t, ReadingListCollectionViewItem*>;
}
- (void)deletePressed {
+ if (![self.editor isEditing]) {
+ return;
+ }
if ([_toolbar state] == NoneSelected) {
[self deleteAllReadItems];
} else {
@@ -563,12 +572,18 @@ using ItemsMapByDate = std::multimap<int64_t, ReadingListCollectionViewItem*>;
}
}
- (void)enterEditingModePressed {
+ if ([self.editor isEditing]) {
+ return;
+ }
self.toolbarState = NoneSelected;
[self.editor setEditing:YES animated:YES];
[_toolbar setEditing:YES];
}
- (void)exitEditingModePressed {
+ if (![self.editor isEditing]) {
+ return;
+ }
[self exitEditingModeAnimated:YES];
}
@@ -667,6 +682,9 @@ using ItemsMapByDate = std::multimap<int64_t, ReadingListCollectionViewItem*>;
}
- (void)markAllRead {
+ if (![self.editor isEditing]) {
+ return;
+ }
if (![self hasItemInSection:SectionIdentifierUnread]) {
[self exitEditingModeAnimated:YES];
return;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698