Browse Source

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).
master
paweldomas 6 years ago
parent
commit
64f8a8d700

+ 7
- 1
react/features/notifications/components/AbstractNotificationsContainer.js View File

142
      * @returns {void}
142
      * @returns {void}
143
      */
143
      */
144
     _onDismissed(uid) {
144
     _onDismissed(uid) {
145
-        this._clearNotificationDismissTimeout();
145
+        const { _notifications } = this.props;
146
+
147
+        // Clear the timeout only if it's the top notification that's being
148
+        // dismissed (the timeout is set only for the top one).
149
+        if (!_notifications.length || _notifications[0].uid === uid) {
150
+            this._clearNotificationDismissTimeout();
151
+        }
146
 
152
 
147
         this.props.dispatch(hideNotification(uid));
153
         this.props.dispatch(hideNotification(uid));
148
     }
154
     }

Loading…
Cancel
Save