diff --git a/app/javascript/gabsocial/components/status_list.js b/app/javascript/gabsocial/components/status_list.js index 262f9635..91bbc511 100644 --- a/app/javascript/gabsocial/components/status_list.js +++ b/app/javascript/gabsocial/components/status_list.js @@ -27,7 +27,7 @@ export default class StatusList extends ImmutablePureComponent { onDequeueTimeline: PropTypes.func, }; - componentWillUnmount() { + componentDidMount() { this.handleDequeueTimeline(); }; @@ -73,6 +73,7 @@ export default class StatusList extends ImmutablePureComponent { handleDequeueTimeline = () => { const { onDequeueTimeline, timelineId } = this.props; + if (!onDequeueTimeline || !timelineId) return; onDequeueTimeline(timelineId); } diff --git a/app/javascript/gabsocial/features/notifications/index.js b/app/javascript/gabsocial/features/notifications/index.js index 9f4a7c35..0f932627 100644 --- a/app/javascript/gabsocial/features/notifications/index.js +++ b/app/javascript/gabsocial/features/notifications/index.js @@ -69,10 +69,10 @@ class Notifications extends React.PureComponent { this.handleScrollToTop.cancel(); this.handleScroll.cancel(); this.props.dispatch(scrollTopNotifications(false)); - this.handleDequeueNotifications(); } componentDidMount() { + this.handleDequeueNotifications(); this.props.dispatch(scrollTopNotifications(true)); }