Quellcode durchsuchen

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 vor 6 Jahren
Ursprung
Commit
64f8a8d700

+ 7
- 1
react/features/notifications/components/AbstractNotificationsContainer.js Datei anzeigen

@@ -142,7 +142,13 @@ export default class AbstractNotificationsContainer<P: Props>
142 142
      * @returns {void}
143 143
      */
144 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 153
         this.props.dispatch(hideNotification(uid));
148 154
     }

Laden…
Abbrechen
Speichern