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

import './body.html';
import './foursquareClient.js';

mapVars = {
  mymap: null,
  totalDistance: 0,
  totalCheckinCount: 0,
  countriesArr: [],
  countriesTotal: 0,
  markersGroup: null,
  latlngArr: [],
  previousLocation: null,
  currentLocation: null,
  latestApiVersion: null,
  code: null
};

cookies = new Cookies();

Template.body.onCreated(function () {

  //Initialize foundation
  $(document).foundation();

   //Get the potential code from the URL
   mapVars.code = getCode();

   if(mapVars.code != undefined ) {
       Session.set('code', mapVars.code)
   }

   //If the user has previously used the app, use the saved cookie holding the auth token
   if(!cookies.has('authToken') && mapVars.code != null) {
       //Get auth token using the code obtained from the URL
       getAuthToken();
   } else {
       Session.set('authToken', cookies.get('authToken'));
   }

});


Template.body.helpers({

    connectedToFoursquare: function() {
        //Return the boolean state of the connection to the template
        return !Session.equals('authToken', "") && !Session.equals('authToken', undefined);
    }
});


Template.map.onRendered(function(){ 

    L.Icon.Default.imagePath = Meteor.settings.public.leaflet.defaultMarker;

    //Create new cluster group to hold the markers
    mapVars.markersGroup = new L.markerClusterGroup();

    //Create a new leaflet map

    //var currentLocation = getCurrentLocation.init();
    var currentLocation = null;<commit_msg>Fixed issue with missing cookie<commit_after>import { Template } from 'meteor/templating';

import './body.html';
import './foursquareClient.js';

mapVars = {
  mymap: null,
  totalDistance: 0,
  totalCheckinCount: 0,
  countriesArr: [],
  countriesTotal: 0,
  markersGroup: null,
  latlngArr: [],
  previousLocation: null,
  currentLocation: null,
  latestApiVersion: null,
  code: null
};

cookies = new Cookies();

Template.body.onCreated(function () {

  //Initialize foundation
  $(document).foundation();

   //Get the potential code from the URL
   mapVars.code = getCode();

   if(mapVars.code != undefined ) {
       Session.set('code', mapVars.code)
   }

   //If the user has previously used the app, use the saved cookie holding the auth token
   if(!cookies.has('authToken') && mapVars.code != undefined) {
       //Get auth token using the code obtained from the URL
       getAuthToken();
   } else if(cookies.has('authToken')) {
       Session.set('authToken', cookies.get('authToken'));
   }

});


Template.body.helpers({

    connectedToFoursquare: function() {
        //Return the boolean state of the connection to the template
        return !Session.equals('authToken', "") && !Session.equals('authToken', undefined);
    }
});


Template.map.onRendered(function(){ 

    L.Icon.Default.imagePath = Meteor.settings.public.leaflet.defaultMarker;

    //Create new cluster group to hold the markers
    mapVars.markersGroup = new L.markerClusterGroup();

    //Create a new leaflet map

    //var currentLocation = getCurrentLocation.init();
    var currentLocation = null;
{'fraction_non_alphanumeric': 0.12778840025493945, 'fraction_numerical': 0.0019120458891013384, 'mean_word_length': 3.452482269503546, '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': '4966587', 'n_tokens_mistral': 947, 'n_tokens_neox': 929, 'n_words': 252}