Created
March 27, 2016 10:48
-
-
Save dai-shi/1e0b6dea30645260aceb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/imports/ui/App.jsx b/imports/ui/App.jsx | |
| index 3347daf..1500877 100644 | |
| --- a/imports/ui/App.jsx | |
| +++ b/imports/ui/App.jsx | |
| @@ -38,7 +38,11 @@ class App extends Component { | |
| } | |
| renderTasks() { | |
| - return this.props.tasks.map((task) => ( | |
| + let filteredTasks = this.props.tasks; | |
| + if (this.state.hideCompleted) { | |
| + filteredTasks = filteredTasks.filter(task => !task.checked); | |
| + } | |
| + return filteredTasks.map((task) => ( | |
| <Task key={task._id} task={task} /> | |
| )); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment