about summary refs log tree commit diff
path: root/app/assets/javascripts
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-10-03 18:17:06 +0200
committerEugen Rochko <eugen@zeonfederated.com>2016-10-03 18:17:06 +0200
commit7b9a4af3112dc4edcd378dc94190e2eb8e041f56 (patch)
tree8a817939f09f0b5fca6b46feb44b8ef6f9113e86 /app/assets/javascripts
parent2c9e672ee2437677d6e39383e5f8e8e0837024b9 (diff)
API for blocking and unblocking
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r--app/assets/javascripts/components/components/status_content.jsx4
-rw-r--r--app/assets/javascripts/components/containers/mastodon.jsx12
2 files changed, 11 insertions, 5 deletions
diff --git a/app/assets/javascripts/components/components/status_content.jsx b/app/assets/javascripts/components/components/status_content.jsx
index 285945fa8..99d83b609 100644
--- a/app/assets/javascripts/components/components/status_content.jsx
+++ b/app/assets/javascripts/components/components/status_content.jsx
@@ -26,7 +26,7 @@ const StatusContent = React.createClass({
       } else {
         link.setAttribute('target', '_blank');
         link.setAttribute('rel', 'noopener');
-        link.addEventListener('click', this.onNormalClick);
+        link.addEventListener('click', this.onNormalClick.bind(this));
       }
     }
   },
@@ -36,7 +36,7 @@ const StatusContent = React.createClass({
       e.preventDefault();
       this.context.router.push(`/accounts/${mention.get('id')}`);
     }
-    
+
     e.stopPropagation();
   },
 
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'));
           }
         }
       });