Fix regression when marking notifications as read #1214
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
74e0112 introduced a regression that caused notifications not being marked as read after opening them in most cases:
gh4a/app/src/main/java/com/gh4a/fragment/NotificationListFragment.java
Lines 143 to 146 in 74e0112
When the above
if
condition is true, the notification is not marked as read.This PR proposes a simpler fix for #1208 since the problem with "unsupported" notifications (like discussion ones) is that they don't have a URL, because if they had it, the URL would be opened in a browser/custom tab instead of doing nothing.
I've tested this fix with a PR notification and a discussion notification and it behaved as expected.