From c1c96d1a1e181205884d9bd2752a3f918364d32e Mon Sep 17 00:00:00 2001 From: David Sinclair Date: Wed, 4 Jan 2023 16:59:07 -0600 Subject: [PATCH 1/2] #1751 (don't allow double-tap to open original story while on story titles) - Restored double-tap preference on iPhone; defaults to open original story, and only affects story view, not feed detail. --- .../ios/Resources/Settings.bundle/Root.plist | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/clients/ios/Resources/Settings.bundle/Root.plist b/clients/ios/Resources/Settings.bundle/Root.plist index b7c1c6369..a66021f2c 100644 --- a/clients/ios/Resources/Settings.bundle/Root.plist +++ b/clients/ios/Resources/Settings.bundle/Root.plist @@ -606,6 +606,34 @@ DefaultValue + + FooterText + + Type + PSMultiValueSpecifier + Title + Double tap story + Titles + + Open original story + Show original text + Mark as unread + Save story + Do nothing + + DefaultValue + open_original_story + Values + + open_original_story + show_original_text + mark_unread + save_story + nothing + + Key + double_tap_story + FooterText Double tap with two fingers to use this gesture. From c95bf08a5f9645829c35d9f400929dc2f05bed1c Mon Sep 17 00:00:00 2001 From: David Sinclair Date: Wed, 4 Jan 2023 21:29:06 -0600 Subject: [PATCH 2/2] #1771 (cannot delete or move top level feed) - Fixed. - Investigating wacky situation where the table could attempt to access an out-of-range cell. --- clients/ios/Classes/FeedDetailObjCViewController.m | 4 ++-- clients/ios/Classes/FeedsObjCViewController.m | 10 +++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/clients/ios/Classes/FeedDetailObjCViewController.m b/clients/ios/Classes/FeedDetailObjCViewController.m index 77566e89f..54c938d09 100644 --- a/clients/ios/Classes/FeedDetailObjCViewController.m +++ b/clients/ios/Classes/FeedDetailObjCViewController.m @@ -2300,7 +2300,7 @@ didEndSwipingSwipingWithState:(MCSwipeTableViewCellState)state } } - if (!everything && !infrequent && !saved && !read && !social && !widget) { + if ((!everything || !appDelegate.storiesCollection.isRiverView) && !infrequent && !saved && !read && !social && !widget) { NSString *manageText = [NSString stringWithFormat:@"Manage this %@", appDelegate.storiesCollection.isRiverView ? @"folder" : @"site"]; [viewController addTitle:manageText iconName:@"menu_icn_move.png" selectionShouldDismiss:NO handler:^{ @@ -2489,7 +2489,7 @@ didEndSwipingSwipingWithState:(MCSwipeTableViewCellState)state __weak MenuViewController *weakViewController = viewController; viewController.title = manageText; - if (!everything) { + if (!everything || !appDelegate.storiesCollection.isRiverView) { NSString *deleteText = [NSString stringWithFormat:@"Delete %@", appDelegate.storiesCollection.isRiverView ? @"this entire folder" : diff --git a/clients/ios/Classes/FeedsObjCViewController.m b/clients/ios/Classes/FeedsObjCViewController.m index 74c996ed0..c3fd00a41 100644 --- a/clients/ios/Classes/FeedsObjCViewController.m +++ b/clients/ios/Classes/FeedsObjCViewController.m @@ -1476,13 +1476,21 @@ static NSArray *NewsBlurTopSectionNames; count = limit; } +// NSLog(@"Folder %@ contains %@ feeds", folderName, @(count)); // log + return count; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { NSString *folderName = [appDelegate.dictFoldersArray objectAtIndex:indexPath.section]; - id feedId = [[appDelegate.dictFolders objectForKey:folderName] objectAtIndex:indexPath.row]; + NSArray *folder = [appDelegate.dictFolders objectForKey:folderName]; + + if (indexPath.row >= folder.count) { + NSLog(@"Detected attempt to access row %@ of %@ when there are only %@; this will crash!", @(indexPath.row), folderName, @(folder.count)); // log + } + + id feedId = [folder objectAtIndex:indexPath.row]; NSString *feedIdStr = [NSString stringWithFormat:@"%@",feedId]; BOOL isSavedSearch = [appDelegate isSavedSearch:feedIdStr]; NSString *searchQuery = [appDelegate searchQueryForFeedId:feedIdStr];