fix(AbstractNotificationsContainer): broken timeouts chain
If user dismisses the not topmost notification the timeout will be cleared and a new one will not be set, because the top notification remained the same (see the if at line 90).
This commit is contained in:
parent
95f684da2f
commit
64f8a8d700
|
@ -142,7 +142,13 @@ export default class AbstractNotificationsContainer<P: Props>
|
||||||
* @returns {void}
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
_onDismissed(uid) {
|
_onDismissed(uid) {
|
||||||
|
const { _notifications } = this.props;
|
||||||
|
|
||||||
|
// Clear the timeout only if it's the top notification that's being
|
||||||
|
// dismissed (the timeout is set only for the top one).
|
||||||
|
if (!_notifications.length || _notifications[0].uid === uid) {
|
||||||
this._clearNotificationDismissTimeout();
|
this._clearNotificationDismissTimeout();
|
||||||
|
}
|
||||||
|
|
||||||
this.props.dispatch(hideNotification(uid));
|
this.props.dispatch(hideNotification(uid));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue