瀏覽代碼

Finalize location on scrollable notifications when unmounting (#6614)

The top of the scrollable notifications will be invisible after unmounting.
The Redux state should be updated accordingly in such a case so that the
unread notification counter will be updated later.
master
Akihiko Odaki 6 年之前
committed by Eugen Rochko
父節點
當前提交
45feb439bd
共有 1 個檔案被更改,包括 7 行新增0 行删除
  1. +7
    -0
      app/javascript/mastodon/features/notifications/index.js

+ 7
- 0
app/javascript/mastodon/features/notifications/index.js 查看文件

@@ -50,6 +50,13 @@ export default class Notifications extends React.PureComponent {
trackScroll: true,
};

componentWillUnmount () {
this.handleScrollToBottom.cancel();
this.handleScrollToTop.cancel();
this.handleScroll.cancel();
this.props.dispatch(scrollTopNotifications(false));
}

handleScrollToBottom = debounce(() => {
this.props.dispatch(scrollTopNotifications(false));
this.props.dispatch(expandNotifications());


Loading…
取消
儲存