diff options
author | Thibaut Girka <thib@sitedethib.com> | 2018-05-27 17:10:48 +0200 |
---|---|---|
committer | ThibG <thib@sitedethib.com> | 2018-05-27 20:39:25 +0200 |
commit | 1fa3586db5d2e56480536377fea8bc52672e0516 (patch) | |
tree | a9d0bf9ec55c304afe7aca7adc44bed726c36004 /app/javascript/flavours/glitch/features/standalone/public_timeline | |
parent | d959d04133e619955100c58bc21e157f18db1fb1 (diff) |
[Glitch] Use streaming API for standalone timelines on /about and /tag pages
Port 0128b86d3098042cdbc3a1629f74b70f665f8dfb to glitch-soc
Diffstat (limited to 'app/javascript/flavours/glitch/features/standalone/public_timeline')
-rw-r--r-- | app/javascript/flavours/glitch/features/standalone/public_timeline/index.js | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/app/javascript/flavours/glitch/features/standalone/public_timeline/index.js b/app/javascript/flavours/glitch/features/standalone/public_timeline/index.js index 717f6fcaf..8e1ad4e52 100644 --- a/app/javascript/flavours/glitch/features/standalone/public_timeline/index.js +++ b/app/javascript/flavours/glitch/features/standalone/public_timeline/index.js @@ -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; } } |