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.
This commit is contained in:
		
							parent
							
								
									359e441fb2
								
							
						
					
					
						commit
						bec845b7f7
					
				
					 1 changed files with 7 additions and 0 deletions
				
			
		|  | @ -50,6 +50,13 @@ export default class Notifications extends React.PureComponent { | ||||||
|     trackScroll: true, |     trackScroll: true, | ||||||
|   }; |   }; | ||||||
| 
 | 
 | ||||||
|  |   componentWillUnmount () { | ||||||
|  |     this.handleScrollToBottom.cancel(); | ||||||
|  |     this.handleScrollToTop.cancel(); | ||||||
|  |     this.handleScroll.cancel(); | ||||||
|  |     this.props.dispatch(scrollTopNotifications(false)); | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|   handleScrollToBottom = debounce(() => { |   handleScrollToBottom = debounce(() => { | ||||||
|     this.props.dispatch(scrollTopNotifications(false)); |     this.props.dispatch(scrollTopNotifications(false)); | ||||||
|     this.props.dispatch(expandNotifications()); |     this.props.dispatch(expandNotifications()); | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue