<commit_before>'use strict';
import angular from 'angular';
import $ from 'jquery';
let ipc = require('ipc');

const FolderCtrl = ($scope) => {

  ipc.send('folders', {query: 'get'});
  ipc.on('folders/get', (res) => {
    if(res.status === 200) {
      $scope.folders = res.data.folders;
      $scope.safeApply();
    } else if(res.status === 404) {
      console.log('Could not find the folders')
    }
  });
  $scope.safeApply = function(fn) {
    var phase = this.$root.$$phase;
    if(phase === '$apply' || phase === '$digest') {
      if(fn && (typeof(fn) === 'function')) {
        fn();
      }
    } else {
      this.$apply(fn);
    }
  };
}

module.exports = FolderCtrl;<commit_msg>correct adding folders to view<commit_after>'use strict';
import angular from 'angular';
import $ from 'jquery';
let ipc = require('ipc');

const FolderCtrl = ($scope) => {

  //Get all folders when page loads
  ipc.send('folders', {query: 'get'});
  ipc.on('folders/get', (res) => {
    console.log(res);
    if(res.status === 200) {
      $scope.folders = res.data;
      $scope.safeApply();
    } else if(res.status === 404) {
      console.log('Could not find the folders')
    }
  });
  $scope.safeApply = function(fn) {
    var phase = this.$root.$$phase;
    if(phase === '$apply' || phase === '$digest') {
      if(fn && (typeof(fn) === 'function')) {
        fn();
      }
    } else {
      this.$apply(fn);
    }
  };
}

module.exports = FolderCtrl;
{'fraction_non_alphanumeric': 0.20440467997247075, 'fraction_numerical': 0.008258774948382657, 'mean_word_length': 2.806282722513089, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '7384311', 'n_tokens_mistral': 521, 'n_tokens_neox': 497, 'n_words': 110}