<commit_before>Template.notificationItem.helpers({
  niceTime: function () {
    return moment(this.timestamp).fromNow();
  },
  notificationHTML: function () {
    return this.message();
  }
});

Template.notificationItem.events({
  'click .action-link': function (event, template) {
    var notificationId = template.data._id;

    Herald.collection.update({ _id: notificationId }, {
      $set: { read: true }
    },
    function (error, result) {
      if (error) {
        console.log(error);
      } 
    });  
  }
});<commit_msg>Fix marking notifications as read<commit_after>Template.notificationItem.helpers({
  niceTime: function () {
    return moment(this.timestamp).fromNow();
  },
  notificationHTML: function () {
    return this.message();
  }
});

Template.notificationItem.events({
  'click .action-link': function (event, template) {
    var notificationId = this._id;

    Herald.collection.update(notificationId, {
      $set: { read: true }
    },
    function (error, result) {
      if (error) {
        console.log(error);
      } 
    });  
  }
});
{'fraction_non_alphanumeric': 0.15083798882681565, 'fraction_numerical': 0.0, 'mean_word_length': 2.996282527881041, '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': '4221681', 'n_tokens_mistral': 326, 'n_tokens_neox': 321, 'n_words': 62}