|
@@ -13,9 +13,16 @@ App = React.createClass({
|
|
|
|
|
|
// Loads items from the Tasks collection and puts them on this.data.tasks.
|
|
// Loads items from the Tasks collection and puts them on this.data.tasks.
|
|
getMeteorData() {
|
|
getMeteorData() {
|
|
|
|
+ let query = {};
|
|
|
|
+
|
|
|
|
+ if (this.state.hideCompleted) {
|
|
|
|
+ // If hideCompleted is checked, filter tasks.
|
|
|
|
+ query = { checked: { $ne: true} };
|
|
|
|
+ }
|
|
let result = {
|
|
let result = {
|
|
- tasks: Tasks.find({}, {sort: {createdAt: -1}}).fetch()
|
|
|
|
|
|
+ tasks: Tasks.find(query, { sort: { createdAt: -1 }}).fetch()
|
|
};
|
|
};
|
|
|
|
+
|
|
// Meteor._debug("result", result);
|
|
// Meteor._debug("result", result);
|
|
return result;
|
|
return result;
|
|
},
|
|
},
|