Notifications now check to see the thread they are supposed to open
exists.
Also, clean up FocusedContentStore._onFocus so that it doesn't have the side
effect of dispatching another action and messay logic.
Instead, added Actions.ensureCategoryFocused, to focus any category, and which
should be used separately from focusing content (notifications now use
this action for "opening" the thread)
Also, convert FocusedPerspectiveStore to ES6
Fixes#1393
The objects returned by `new Notification()` have a `.close()` method.
So we can just keep a list of notifications that have been sent, and
close them when that message has been read.
Conflicts:
internal_packages/unread-notifications/lib/main.es6
* Remove double negative from test label
It always takes me a second to read a double negative, and be sure I
understood correctly. It's also particularly troublesome for non-native
English speakers.
* Change pending unread notification stack to be a queue
Consider the case where a user launches N1, and has 3 unreads since
their last launch. Additionally, after N1 has launched, they begin
receiving a new mail every 2 seconds.
Current behavior would be a notification for 1 of the 3 unread emails,
then every 2 seconds a notification for the most recently received mail.
They would only finally receive notifications for the other 2 original
messages once they stopped getting new mail.