<commit_before>import site from '../app';

site.controller('navController', ($scope, $mdSidenav, $state, UserStatus, WrappedFirebase, $firebaseAuth, SidebarManagement, DisconnectNotifier) => {
  $scope.toggleList = () => {
    $mdSidenav('left').toggle();
  };

  $scope.connected = true;

  DisconnectNotifier.setCallback('on', () => {
    $scope.connected = true;
  });

  DisconnectNotifier.setCallback('off', () => {
    $scope.connected = false;
  });

  $scope.sidebar = SidebarManagement;

  $scope.logins = [
    {
      name: 'Facebook',
      icon: 'facebook'
    },
    {
      name: 'Twitter',
      icon: 'twitter'
    },
    {
      name: 'Google',
      icon: 'google-plus'
    }
  ];

  const auth = $firebaseAuth(WrappedFirebase);

  const handleAuth = (authData, wipe = true) => {
    const provider = authData.auth.provider;
    UserStatus.displayName = authData[provider].displayName;
    UserStatus.loggedIn = true;
    UserStatus.authData = authData;

    if(!wipe) return;
    WrappedFirebase.child('users').child(authData.uid).set({
      provider: authData.auth.provider,
      name: authData[authData.auth.provider].displayName
    });
  };

  const attemptAuth = auth.$getAuth();
  if(attemptAuth) handleAuth(attemptAuth, false);

  $scope.doLogin = (service) => {
    auth.$authWithOAuthPopup(service.toLowerCase())
    .then((authData) => {
      handleAuth(authData);
      $state.go('userManage');
    })
    .catch((error) => {
      console.error('Authentication failed', error);
    });
  };

  $scope.doLogout = () => {
    auth.$unauth();
    UserStatus.loggedIn = false;
    $state.go('home');
  };
});<commit_msg>digest scope after changing a var via firebase<commit_after>import site from '../app';

site.controller('navController', ($scope, $mdSidenav, $state, UserStatus, WrappedFirebase, $firebaseAuth, SidebarManagement, DisconnectNotifier) => {
  $scope.toggleList = () => {
    $mdSidenav('left').toggle();
  };

  $scope.connected = true;

  DisconnectNotifier.setCallback('on', () => {
    $scope.connected = true;
    $scope.$digest();
  });

  DisconnectNotifier.setCallback('off', () => {
    $scope.connected = false;
    $scope.$digest();
  });
  

  $scope.sidebar = SidebarManagement;

  $scope.logins = [
    {
      name: 'Facebook',
      icon: 'facebook'
    },
    {
      name: 'Twitter',
      icon: 'twitter'
    },
    {
      name: 'Google',
      icon: 'google-plus'
    }
  ];

  const auth = $firebaseAuth(WrappedFirebase);

  const handleAuth = (authData, wipe = true) => {
    const provider = authData.auth.provider;
    UserStatus.displayName = authData[provider].displayName;
    UserStatus.loggedIn = true;
    UserStatus.authData = authData;

    if(!wipe) return;
    WrappedFirebase.child('users').child(authData.uid).set({
      provider: authData.auth.provider,
      name: authData[authData.auth.provider].displayName
    });
  };

  const attemptAuth = auth.$getAuth();
  if(attemptAuth) handleAuth(attemptAuth, false);

  $scope.doLogin = (service) => {
    auth.$authWithOAuthPopup(service.toLowerCase())
    .then((authData) => {
      handleAuth(authData);
      $state.go('userManage');
    })
    .catch((error) => {
      console.error('Authentication failed', error);
    });
  };

  $scope.doLogout = () => {
    auth.$unauth();
    UserStatus.loggedIn = false;
    $state.go('home');
  };
});
{'fraction_non_alphanumeric': 0.16913069189828503, 'fraction_numerical': 0.0, 'mean_word_length': 3.192069392812887, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5912082', 'n_tokens_mistral': 1122, 'n_tokens_neox': 1092, 'n_words': 175}