'use strict';

angular.module('MLDS').controller('LandingRedirectController', 
		['$scope', '$rootScope', 'Session', '$log', '$location', '$route', 'AuthenticationSharedService',
         function ($scope, $rootScope, Session, $log, $location, $route, AuthenticationSharedService) {
			$log.log('LandingRedirectController starting', $location.path(), $route.current, window.location.hash)

      		Session.promise
      			.then(function() {
      				$log.log('LandingRedirectController redirecting', $location.path(), $route.current, window.location.hash)
      				if (Session.isStaffOrAdmin()) {
      					$location.path('/pendingApplications').replace();		
      				} else if (Session.isUser()) {
      		        	UserAffiliateService.promise.then(function() {
      		        		if (ApplicationUtilsService.isApplicationWaitingForApplicant(UserAffiliateService.affiliate.application)) {
      		        			$location.path('/affiliateRegistration');
      		        		} else {
	      		        		$location.path('/dashboard').replace();
      		        		}
      		        	});
      					
      				} else {
      					$location.path('/landing').replace();
      				}
      			});
          }]);

@@ -171,16 +171,67 @@
 ervice',
+ 'UserAffiliateService', 'ApplicationUtilsService',
 %0A       
@@ -323,16 +323,63 @@
 dService
+, UserAffiliateService, ApplicationUtilsService
 ) %7B%0A%09%09%09$

Fix landing page bounce