summaryrefslogtreecommitdiffstats
path: root/app/assets
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets')
-rw-r--r--app/assets/javascripts/components/features/hashtag_timeline/index.jsx10
-rw-r--r--app/assets/javascripts/components/features/public_timeline/index.jsx18
2 files changed, 20 insertions, 8 deletions
diff --git a/app/assets/javascripts/components/features/hashtag_timeline/index.jsx b/app/assets/javascripts/components/features/hashtag_timeline/index.jsx
index de6a9618e12..bea0a2759e5 100644
--- a/app/assets/javascripts/components/features/hashtag_timeline/index.jsx
+++ b/app/assets/javascripts/components/features/hashtag_timeline/index.jsx
@@ -4,7 +4,8 @@ import StatusListContainer from '../ui/containers/status_list_container';
import Column from '../ui/components/column';
import {
refreshTimeline,
- updateTimeline
+ updateTimeline,
+ deleteFromTimelines
} from '../../actions/timelines';
const HashtagTimeline = React.createClass({
@@ -24,7 +25,12 @@ const HashtagTimeline = React.createClass({
}, {
received (data) {
- dispatch(updateTimeline('tag', JSON.parse(data.message)));
+ switch(data.type) {
+ case 'update':
+ return dispatch(updateTimeline('tag', JSON.parse(data.message)));
+ case 'delete':
+ return dispatch(deleteFromTimelines(data.id));
+ }
}
});
diff --git a/app/assets/javascripts/components/features/public_timeline/index.jsx b/app/assets/javascripts/components/features/public_timeline/index.jsx
index 8b2a869471c..12f73ba9bf4 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));
+ }
}
});