logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe
commit: 45feb439bd22c0999b8531879461e8d18fabe8a5
parent: 44829d8216001e3d8183dbd12cacc5a2f4826751
Author: Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
Date:   Sun,  4 Mar 2018 16:55:15 +0900

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.

Diffstat:

Mapp/javascript/mastodon/features/notifications/index.js7+++++++
1 file changed, 7 insertions(+), 0 deletions(-)

diff --git a/app/javascript/mastodon/features/notifications/index.js b/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());