<commit_before>Template.settings.created = function () {
  // Get reference to template instance
  var instance = this;

  // Subscribe to setings
  instance.subscribe("settings");
};

Template.settings.helpers({
  settings: function () {
    var settings = Settings.findOne();

    return settings;
  }
});<commit_msg>Instance subscription checks; logo helper<commit_after>Template.settings.created = function () {
  // Get reference to template instance
  var instance = this;

  // Subscribe to setings
  instance.settingsSubscription = instance.subscribe("settings");

  instance.autorun(function () {
    if (instance.settingsSubscription.ready()) {
      // Get Settings
      var settings = Settings.findOne();

      // Get logo ID
      var logoId = settings.brandingImageId;

      // Subscribe to logo file document
      instance.logoSubscription = instance.subscribe("singleFile", logoId);
    }
  });
};

Template.settings.helpers({
  settings: function () {
    var instance = Template.instance();

    if (instance.settingsSubscription.ready()) {
      var settings = Settings.findOne();

      return settings;
    };
  },
  logo: function () {
    var instance = Template.instance();
    if (
        instance.settingsSubscription.ready()
        &&
        instance.logoSubscription.ready()
       ) {
      // Get Settings
      var settings = Settings.findOne();

      // Get logo ID
      var logoId = settings.brandingImageId;

      // Get logo
      var logo = Files.findOne(logoId);

      return logo;
    }
  }
});
{'fraction_non_alphanumeric': 0.118600129617628, 'fraction_numerical': 0.0, 'mean_word_length': 2.7475728155339807, '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': '2866041', 'n_tokens_mistral': 412, 'n_tokens_neox': 409, 'n_words': 102}