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
This commit is contained in:
Eugen Rochko 2016-11-23 22:57:57 +01:00
parent 3373ae02de
commit 7cee27f517
13 changed files with 86 additions and 27 deletions

View file

@ -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
};
};