-
Notifications
You must be signed in to change notification settings - Fork 20
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
#477 | Fixing category selection after deletion #557
Conversation
There was a problem hiding this 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 💯
if let category = Category.fetchObject(in: NSPersistentContainer.shared.viewContext, matching: previous.objectID), | ||
category.isUserRemoved { | ||
return previous.indexPath | ||
} |
There was a problem hiding this comment.
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?
Test verified on: |
There was a problem hiding this 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 🥇
Test verified on: |
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.