Fix follow request notifications not being displayed (#2695)
This commit is contained in:
		
							parent
							
								
									b79df709a8
								
							
						
					
					
						commit
						113c931cda
					
				| 
						 | 
				
			
			@ -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);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue