|
|
|
@ -9,6 +9,7 @@ import { |
|
|
|
|
import Column from 'flavours/glitch/components/column'; |
|
|
|
|
import ColumnHeader from 'flavours/glitch/components/column_header'; |
|
|
|
|
import { defineMessages, injectIntl } from 'react-intl'; |
|
|
|
|
import { connectPublicStream } from 'flavours/glitch/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; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|