<commit_before>angular
	.module('Whatsapp')
	.config(config);

function config($stateProvider, $urlRouterProvider){
	$stateProvider
		.state('tab', {
			url: '/tab',
			abstract: true, 
			templateUrl: 'client/templates/tabs.html'
		})
		.state('tab.chats', {
			      url: '/chats',
			      views: {
			        'tab-chats': {
			          templateUrl: 'client/templates/chats.html',
			          controller: 'ChatsCtrl as chats'
			        }
			}
		})
		.state('tab.chat', {
			url: '/chats/:chatId',
			views: {
				'tab-chats': {
					templateUrl: 'client/templates/chat.html',
					controller: 'ChatCtrl as chat'
				}
			}
		})
		.state('login', {
			url: '/login',
			templateUrl: 'client/templates/login.html',
			controller: 'LoginCtrl as logger'
		})
		.state('confirmation', {
			url: '/confirmation/:phone',
			templateUrl: 'client/templates/confirmation.html',
			controller: 'ConfirmationCtrl as confirmation'
		})
		.state('profile', {
			url: '/profile',
			templateUrl: 'client/templates/profile.html',
			controller: 'ProfileCtrl as profile'
		});

	$urlRouterProvider.otherwise('tab/chats');
}<commit_msg>isAuthorized<commit_after>angular
	.module('Whatsapp')
	.config(config);

function config($stateProvider, $urlRouterProvider){
	$stateProvider
		.state('tab', {
			url: '/tab',
			abstract: true, 
			templateUrl: 'client/templates/tabs.html',
			resolve: {
				user: isAuthorized
			}
		})
		.state('tab.chats', {
			      url: '/chats',
			      views: {
			        'tab-chats': {
			          templateUrl: 'client/templates/chats.html',
			          controller: 'ChatsCtrl as chats'
			        }
			}
		})
		.state('tab.chat', {
			url: '/chats/:chatId',
			views: {
				'tab-chats': {
					templateUrl: 'client/templates/chat.html',
					controller: 'ChatCtrl as chat'
				}
			}
		})
		.state('login', {
			url: '/login',
			templateUrl: 'client/templates/login.html',
			controller: 'LoginCtrl as logger'
		})
		.state('confirmation', {
			url: '/confirmation/:phone',
			templateUrl: 'client/templates/confirmation.html',
			controller: 'ConfirmationCtrl as confirmation'
		})
		.state('profile', {
			url: '/profile',
			templateUrl: 'client/templates/profile.html',
			controller: 'ProfileCtrl as profile',
			resolve: {
				user: isAuthorized
			}
		});

	$urlRouterProvider.otherwise('tab/chats');

	//

  function isAuthorized($q) {
    let deferred = $q.defer();
 
    if (_.isEmpty(Meteor.user()))
      deferred.reject('AUTH_REQUIRED');
    else
      deferred.resolve();
 
    return deferred.promise;
  }
}
{'fraction_non_alphanumeric': 0.16535742340926946, 'fraction_numerical': 0.0, 'mean_word_length': 2.812874251497006, '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': '1039512', 'n_tokens_mistral': 1014, 'n_tokens_neox': 838, 'n_words': 146}