瀏覽代碼

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 年之前
父節點
當前提交
64f8a8d700
共有 1 個檔案被更改,包括 7 行新增1 行删除
  1. 7
    1
      react/features/notifications/components/AbstractNotificationsContainer.js

+ 7
- 1
react/features/notifications/components/AbstractNotificationsContainer.js 查看文件

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…
取消
儲存