Skip to content

Commit

Permalink
Fix follow request notifications not being displayed (#2695)
Browse files Browse the repository at this point in the history
  • Loading branch information
ClearlyClaire authored Apr 24, 2024
1 parent b79df70 commit 113c931
Showing 1 changed file with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,28 @@
import { connect } from 'react-redux';

import { authorizeFollowRequest, rejectFollowRequest } from 'flavours/glitch/actions/accounts';
import { makeGetAccount } from 'flavours/glitch/selectors';

import FollowRequest from '../components/follow_request';

const mapDispatchToProps = (dispatch, { account }) => ({
const makeMapStateToProps = () => {
const getAccount = makeGetAccount();

const mapStateToProps = (state, props) => ({
account: getAccount(state, props.id),
});

return mapStateToProps;
};

const mapDispatchToProps = (dispatch, { id }) => ({
onAuthorize () {
dispatch(authorizeFollowRequest(account.get('id')));
dispatch(authorizeFollowRequest(id));
},

onReject () {
dispatch(rejectFollowRequest(account.get('id')));
dispatch(rejectFollowRequest(id));
},
});

export default connect(null, mapDispatchToProps)(FollowRequest);
export default connect(makeMapStateToProps, mapDispatchToProps)(FollowRequest);

0 comments on commit 113c931

Please sign in to comment.