Use streaming API for standalone timelines on /about and /tag pages (#5998)
This commit is contained in:
		
					parent
					
						
							
								0370ba7b0a
							
						
					
				
			
			
				commit
				
					
						0128b86d30
					
				
			
		
					 3 changed files with 17 additions and 15 deletions
				
			
		|  | @ -9,6 +9,7 @@ import { | |||
| import Column from '../../../components/column'; | ||||
| import ColumnHeader from '../../../components/column_header'; | ||||
| import { defineMessages, injectIntl } from 'react-intl'; | ||||
| import { connectPublicStream } from '../../../actions/streaming'; | ||||
| 
 | ||||
| const messages = defineMessages({ | ||||
|   title: { id: 'standalone.public_title', defaultMessage: 'A look inside...' }, | ||||
|  | @ -35,16 +36,13 @@ export default class PublicTimeline extends React.PureComponent { | |||
|     const { dispatch } = this.props; | ||||
| 
 | ||||
|     dispatch(refreshPublicTimeline()); | ||||
| 
 | ||||
|     this.polling = setInterval(() => { | ||||
|       dispatch(refreshPublicTimeline()); | ||||
|     }, 3000); | ||||
|     this.disconnect = dispatch(connectPublicStream()); | ||||
|   } | ||||
| 
 | ||||
|   componentWillUnmount () { | ||||
|     if (typeof this.polling !== 'undefined') { | ||||
|       clearInterval(this.polling); | ||||
|       this.polling = null; | ||||
|     if (this.disconnect) { | ||||
|       this.disconnect(); | ||||
|       this.disconnect = null; | ||||
|     } | ||||
|   } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue