<commit_before>import { Template } from 'meteor/templating';

import { Tasks } from '../api/tasks.js';

import './body.html';
import './task.js';
var homeReminderBool;

Template.body.helpers({
  tasks() {
    return Tasks.find({}, { sort: { createdAt: -1 } });
  },
});

Template.body.events({
  'click .homeReminder'(){
    console.log(homeReminderBool);
    if (homeReminderBool == null){
      homeReminderBool = true;
    } else {
      homeReminderBool = !homeReminderBool;
    }
    console.log(homeReminderBool);
  },

  'submit .new-task'(event) {
    event.preventDefault();

    // Get value from form element
    const target = event.target;
    const text = target.text.value;

    // Insert a task into the collection
    if (text != ''){
      Tasks.insert({
        text,
        createdAt: new Date(), // current time
      });
    }

    // Clear form
    target.text.value = '';
  },
});<commit_msg>add logic and DB query for homeReminder<commit_after>import { Template } from 'meteor/templating';

import { Tasks } from '../api/tasks.js';

import './body.html';
import './task.js';
var homeReminderBool; //initializing variable for event

Template.body.helpers({
  tasks() {
    return Tasks.find({}, { sort: { createdAt: -1 } });
  },
});

Template.body.events({
  //logic for homeReminder setting
  'click .homeReminder'(){
    if (homeReminderBool == null){
      homeReminderBool = true;
    } else {
      homeReminderBool = !homeReminderBool;
    }
  },

  'submit .new-task'(event) {
    event.preventDefault();
    if(homeReminderBool == undefined) homeReminderBool = false;
    console.log(homeReminderBool);
    // Get value from form element
    const target = event.target;
    const text = target.text.value;
    const homeReminder = homeReminderBool

    // Insert a task into the collection
    if (text != ''){
      Tasks.insert({
        text,
        homeReminder,
        createdAt: new Date(), // current time
      });
    }

    // Clear form
    target.text.value = '';
    $(".homeReminder").prop("checked", false);
  },
});
{'fraction_non_alphanumeric': 0.15232108317214701, 'fraction_numerical': 0.0009671179883945841, 'mean_word_length': 2.6880570409982174, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4467733', 'n_tokens_mistral': 652, 'n_tokens_neox': 645, 'n_words': 155}