From 7cee27f51790617859da87c7aef432373b40aad4 Mon Sep 17 00:00:00 2001
From: Eugen Rochko <eugen@zeonfederated.com>
Date: Wed, 23 Nov 2016 22:57:57 +0100
Subject: Fix unfollows not clearing reblogs, fix blocks not clearing reblogs
 and notifications, skip ActionCable for follow/unfollow/block events, instead
 clear UI from blocked account's posts instantly if block request succeeds.
 Add forgotten i18n for sensitive content

---
 app/assets/javascripts/components/actions/accounts.jsx | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

(limited to 'app/assets/javascripts/components/actions/accounts.jsx')

diff --git a/app/assets/javascripts/components/actions/accounts.jsx b/app/assets/javascripts/components/actions/accounts.jsx
index 4a0777a64..759435afe 100644
--- a/app/assets/javascripts/components/actions/accounts.jsx
+++ b/app/assets/javascripts/components/actions/accounts.jsx
@@ -246,7 +246,8 @@ export function blockAccount(id) {
     dispatch(blockAccountRequest(id));
 
     api(getState).post(`/api/v1/accounts/${id}/block`).then(response => {
-      dispatch(blockAccountSuccess(response.data));
+      // Pass in entire statuses map so we can use it to filter stuff in different parts of the reducers
+      dispatch(blockAccountSuccess(response.data, getState().get('statuses')));
     }).catch(error => {
       dispatch(blockAccountFail(id, error));
     });
@@ -272,10 +273,11 @@ export function blockAccountRequest(id) {
   };
 };
 
-export function blockAccountSuccess(relationship) {
+export function blockAccountSuccess(relationship, statuses) {
   return {
     type: ACCOUNT_BLOCK_SUCCESS,
-    relationship
+    relationship,
+    statuses
   };
 };
 
-- 
cgit 

