about summary refs log tree commit diff
path: root/app/javascript/mastodon/features/notifications/index.js
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2019-09-21 09:12:13 +0200
committerGitHub <noreply@github.com>2019-09-21 09:12:13 +0200
commitba0de8fb68f5e67312446d1ac351f06d093fc2b8 (patch)
tree1b7ba14373d38b49275887e5b613086e5cb5a14f /app/javascript/mastodon/features/notifications/index.js
parenta90243a712ac17708de898e302e337de05b7699d (diff)
Fix updates being hidden behind pending items on unmounted components (#11898)
Diffstat (limited to 'app/javascript/mastodon/features/notifications/index.js')
-rw-r--r--app/javascript/mastodon/features/notifications/index.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/javascript/mastodon/features/notifications/index.js b/app/javascript/mastodon/features/notifications/index.js
index 7e5de0613..d16a0f33a 100644
--- a/app/javascript/mastodon/features/notifications/index.js
+++ b/app/javascript/mastodon/features/notifications/index.js
@@ -4,7 +4,7 @@ import PropTypes from 'prop-types';
 import ImmutablePropTypes from 'react-immutable-proptypes';
 import Column from '../../components/column';
 import ColumnHeader from '../../components/column_header';
-import { expandNotifications, scrollTopNotifications, loadPending } from '../../actions/notifications';
+import { expandNotifications, scrollTopNotifications, loadPending, mountNotifications, unmountNotifications } from '../../actions/notifications';
 import { addColumn, removeColumn, moveColumn } from '../../actions/columns';
 import NotificationContainer from './containers/notification_container';
 import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
@@ -66,11 +66,16 @@ class Notifications extends React.PureComponent {
     trackScroll: true,
   };
 
+  componentWillMount() {
+    this.props.dispatch(mountNotifications());
+  }
+
   componentWillUnmount () {
     this.handleLoadOlder.cancel();
     this.handleScrollToTop.cancel();
     this.handleScroll.cancel();
     this.props.dispatch(scrollTopNotifications(false));
+    this.props.dispatch(unmountNotifications());
   }
 
   handleLoadGap = (maxId) => {