Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#477 | Fixing category selection after deletion #557

Merged
merged 2 commits into from
Apr 13, 2022

Conversation

jsmorgan42
Copy link
Contributor

closes #477

Description of Work

Fixing a bug where after deleting the first category and navigating back to the home screen, the second category was selected inside of the first.


Copy link
Collaborator

@Clstroud Clstroud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one question I'd like to make sure is a non-issue before I unblock this thing. Otherwise, nice and simple fix 💯

Comment on lines 197 to 200
if let category = Category.fetchObject(in: NSPersistentContainer.shared.viewContext, matching: previous.objectID),
category.isUserRemoved {
return previous.indexPath
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been staring at this for a hot minute and I'm wondering if I'm misunderstanding something. previous.indexPath is no longer relevant to the new snapshot and could even be (I suppose?) out of bounds for said new snapshot, right?

What happens if you return nil instead?

@rowildcard
Copy link
Contributor

Test verified on:
simulator iPhone 8 Plus, iOS 15.4
iPhone 12 Pro Max, iOS 15.1

Copy link
Collaborator

@Clstroud Clstroud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯 Much safer. Good stuff 🥇

@CananArikan
Copy link
Contributor

Test verified on:
simulator iPhone 8, iOS 15.4
iPad Pro (11-inch) (3rd generation) 15.3.1

@jsmorgan42 jsmorgan42 merged commit daac689 into develop Apr 13, 2022
@jsmorgan42 jsmorgan42 deleted the bugfix/477-category-selection-after-deletion branch April 13, 2022 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

iOS - Unexpected view on Home Screen after deleting category.
5 participants