From 7b9a4af3112dc4edcd378dc94190e2eb8e041f56 Mon Sep 17 00:00:00 2001
From: Eugen Rochko <eugen@zeonfederated.com>
Date: Mon, 3 Oct 2016 18:17:06 +0200
Subject: API for blocking and unblocking

---
 app/assets/javascripts/components/containers/mastodon.jsx | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

(limited to 'app/assets/javascripts/components/containers/mastodon.jsx')

diff --git a/app/assets/javascripts/components/containers/mastodon.jsx b/app/assets/javascripts/components/containers/mastodon.jsx
index 5f691b4bc..220ddc54d 100644
--- a/app/assets/javascripts/components/containers/mastodon.jsx
+++ b/app/assets/javascripts/components/containers/mastodon.jsx
@@ -40,11 +40,15 @@ const Mastodon = React.createClass({
 
     if (typeof App !== 'undefined') {
       App.timeline = App.cable.subscriptions.create("TimelineChannel", {
-        connected: function() {},
+        connected () {
 
-        disconnected: function() {},
+        },
 
-        received: function(data) {
+        disconnected () {
+
+        },
+
+        received (data) {
           switch(data.type) {
             case 'update':
               return store.dispatch(updateTimeline(data.timeline, JSON.parse(data.message)));
@@ -53,6 +57,8 @@ const Mastodon = React.createClass({
             case 'merge':
             case 'unmerge':
               return store.dispatch(refreshTimeline('home'));
+            case 'block':
+              return store.dispatch(refreshTimeline('mentions'));
           }
         }
       });
-- 
cgit 

