Skip to content

Fixes comment notification from not disappearing from notes list on Spam/Trash#2832

Merged
nbradbury merged 3 commits intodevelopfrom
issue/2816-notifications-moderation-list
Jun 12, 2015
Merged

Fixes comment notification from not disappearing from notes list on Spam/Trash#2832
nbradbury merged 3 commits intodevelopfrom
issue/2816-notifications-moderation-list

Conversation

@roundhill
Copy link
Copy Markdown
Contributor

I wish this was a more elegant solution, maybe the reviewer might have a better idea :)

The NotificationsListFragment needed to check that a noteId had been hidden when it resumed, so I ended up adding a String var to WPMainActivity which I wasn't too happy with.

Fixes #2816

@roundhill roundhill added this to the 4.2 milestone Jun 11, 2015
@nbradbury nbradbury self-assigned this Jun 11, 2015
@nbradbury
Copy link
Copy Markdown
Contributor

I have to admit, I'm not wild about this solution because I'd really like to keep fragment logic out of WPMainActivity when possible. Of course, sometimes it just isn't possible, but I think it can be done in this situation.

This might be a good case for using a sticky event. Unlike other EventBus events, a sticky event can be received long after it has been posted. So you could post a NoteVisibilityChanged event and have it handled by NotificationListFragment regardless of whether it's currently showing. Just keep in mind that the sticky event will persist until you remove it, so you'll want to call EventBus.getDefault().removeStickyEvent(NoteVisibilityChanged.class) once you've handled it.

@roundhill
Copy link
Copy Markdown
Contributor Author

Yeah I didn't like that either. A Sticky Event sounds perfect, thanks for the tip!

… a note is trashed or spammed."

This reverts commit 7d5c53b.
…he event even if it wasn't created yet.

Fixes #2816
@roundhill
Copy link
Copy Markdown
Contributor Author

@nbradbury the sticky event appears to have worked well! Added in e1605d0

@nbradbury
Copy link
Copy Markdown
Contributor

Looks good! :shipit:

nbradbury added a commit that referenced this pull request Jun 12, 2015
…ns-moderation-list

 Fixes comment notification from not disappearing from notes list on Spam/Trash
@nbradbury nbradbury merged commit 06c3969 into develop Jun 12, 2015
@nbradbury nbradbury deleted the issue/2816-notifications-moderation-list branch June 12, 2015 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants