Filter visible boards by user projects
This commit is contained in:
@ -3,6 +3,8 @@ import { Page } from '../Page';
|
||||
import { BoardCard } from './BoardCard';
|
||||
import { connect } from 'react-redux';
|
||||
import { fetchBoards } from '../../store/actions/boards';
|
||||
import { fetchProjects } from '../../store/actions/projects';
|
||||
import { selectBoardByUserProjects } from '../../store/selectors/boards';
|
||||
|
||||
export class HomePage extends React.Component {
|
||||
render() {
|
||||
@ -65,12 +67,13 @@ export class HomePage extends React.Component {
|
||||
|
||||
componentDidMount() {
|
||||
this.props.dispatch(fetchBoards());
|
||||
this.props.dispatch(fetchProjects());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export const ConnectedHomePage = connect(function(state) {
|
||||
return {
|
||||
boards: state.boards.byID,
|
||||
boards: selectBoardByUserProjects(state.boards.byID, state.projects.byName)
|
||||
};
|
||||
})(HomePage);
|
Reference in New Issue
Block a user