diff --git a/client/src/javascript/components/sidebar/NotificationsButton.tsx b/client/src/javascript/components/sidebar/NotificationsButton.tsx index 72cc3c40..8835bcae 100644 --- a/client/src/javascript/components/sidebar/NotificationsButton.tsx +++ b/client/src/javascript/components/sidebar/NotificationsButton.tsx @@ -1,5 +1,5 @@ import classnames from 'classnames'; -import {Component} from 'react'; +import {Component, createRef} from 'react'; import {defineMessages, injectIntl, WrappedComponentProps} from 'react-intl'; import {observer} from 'mobx-react'; import {reaction} from 'mobx'; @@ -17,6 +17,7 @@ import Tooltip from '../general/Tooltip'; interface NotificationsButtonStates { isLoading: boolean; paginationStart: number; + prevHeight: number; } const loadingIndicatorIcon = ; @@ -65,6 +66,7 @@ const NOTIFICATIONS_PER_PAGE = 10; @observer class NotificationsButton extends Component { tooltipRef: Tooltip | null = null; + notificationsListRef = createRef(); constructor(props: WrappedComponentProps) { super(props); @@ -74,6 +76,7 @@ class NotificationsButton extends Component {this.getTopToolbar()}
{loadingIndicatorIcon}
-
    +
      {notifications.map(this.getNotification)}
    {this.getBottomToolbar()} @@ -243,6 +249,7 @@ class NotificationsButton extends Component { this.setState({ paginationStart: 0, + prevHeight: 0, }); FloodActions.clearNotifications({ @@ -268,6 +275,7 @@ class NotificationsButton extends Component