From bf5f55a6bbfee69e41acfcd14002308c69d8b68c Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Thu, 10 Nov 2016 00:47:47 +0100 Subject: Fix live status removal from public/hashtag channels --- .../components/features/public_timeline/index.jsx | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'app/assets/javascripts/components/features/public_timeline') diff --git a/app/assets/javascripts/components/features/public_timeline/index.jsx b/app/assets/javascripts/components/features/public_timeline/index.jsx index 8b2a86947..12f73ba9b 100644 --- a/app/assets/javascripts/components/features/public_timeline/index.jsx +++ b/app/assets/javascripts/components/features/public_timeline/index.jsx @@ -1,11 +1,12 @@ -import { connect } from 'react-redux'; -import PureRenderMixin from 'react-addons-pure-render-mixin'; +import { connect } from 'react-redux'; +import PureRenderMixin from 'react-addons-pure-render-mixin'; import StatusListContainer from '../ui/containers/status_list_container'; -import Column from '../ui/components/column'; +import Column from '../ui/components/column'; import { refreshTimeline, - updateTimeline -} from '../../actions/timelines'; + updateTimeline, + deleteFromTimelines +} from '../../actions/timelines'; const PublicTimeline = React.createClass({ @@ -24,7 +25,12 @@ const PublicTimeline = React.createClass({ this.subscription = App.cable.subscriptions.create('PublicChannel', { received (data) { - dispatch(updateTimeline('public', JSON.parse(data.message))); + switch(data.type) { + case 'update': + return dispatch(updateTimeline('public', JSON.parse(data.message))); + case 'delete': + return dispatch(deleteFromTimelines(data.id)); + } } }); -- cgit