about summary refs log tree commit diff
path: root/app/assets/javascripts/components/actions/accounts.jsx
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-11-23 22:57:57 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-11-23 22:57:57 +0100
commit7cee27f51790617859da87c7aef432373b40aad4 (patch)
tree68bec6934312f7155faddc96f4b77473ba9a8205 /app/assets/javascripts/components/actions/accounts.jsx
parent3373ae02ded0ac5847350da9f9550721cdebe732 (diff)
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
Diffstat (limited to 'app/assets/javascripts/components/actions/accounts.jsx')
-rw-r--r--app/assets/javascripts/components/actions/accounts.jsx8
1 files changed, 5 insertions, 3 deletions
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
   };
 };