Improve how the list entry Account component looks when target is blocked/follow is requested

This commit is contained in:
Eugen Rochko committed 2017-01-16 19:36:32 +01:00
1 parent 99fe89026c
commit 6cf44ca92c
4 files changed
+43 -7

No files matched your search

@@ -3,7 +3,9 @@ import { makeGetAccount } from '../selectors';
import Account from '../components/account';
import {
followAccount,
unfollowAccount
unfollowAccount,
blockAccount,
unblockAccount
} from '../actions/accounts';
const makeMapStateToProps = () => {
@@ -24,6 +26,14 @@ const mapDispatchToProps = (dispatch) => ({
} else {
dispatch(followAccount(account.get('id')));
}
},
onBlock (account) {
if (account.getIn(['relationship', 'blocking'])) {
dispatch(unblockAccount(account.get('id')));
} else {
dispatch(blockAccount(account.get('id')));
}
}
});