fixing url params when already accepted invite
This commit is contained in:
		
							parent
							
								
									e9d0ce0846
								
							
						
					
					
						commit
						b897d8275a
					
				| @ -158,8 +158,6 @@ app.run(['$rootScope', '$state', 'Auth', '$location', function($rootScope, $stat | ||||
|   $rootScope.urlCrumbs = []; | ||||
|   $rootScope.$on('$stateChangeStart', function(event, toState, toParams, fromState, fromParams) { | ||||
|     var requiresLogin = toState.data.requiresLogin; | ||||
|     toState.data.session = $location.search(); | ||||
|     var query = $location.search(); | ||||
|     var Crumbs = new Object(); | ||||
|     Crumbs = { | ||||
|       absUrl: $location.$$absUrl, | ||||
| @ -171,9 +169,8 @@ app.run(['$rootScope', '$state', 'Auth', '$location', function($rootScope, $stat | ||||
|     }; | ||||
|     $rootScope.urlCrumbs.push(Crumbs); | ||||
|     if (requiresLogin && !Auth.isLoggedIn()) { | ||||
|       if (!angular.equals(toState.data.session, {})) { | ||||
|         $state.go('splash-page', { 'toState': toState.name }); | ||||
|       } | ||||
|       event.preventDefault(); | ||||
|       $state.go('splash-page', { 'toState': toState.name }); | ||||
|     } | ||||
|   }); | ||||
| }]); | ||||
|  | ||||
| @ -66,8 +66,8 @@ app.directive('notificationBar', [function () { | ||||
| }]); | ||||
| 
 | ||||
| app.controller('websiteCtrl', [ | ||||
|   '$scope', '$q', 'Auth', 'azp@oauth3.org', '$timeout', '$sce', '$rootScope', | ||||
|   function ($scope, $q, Auth, Oauth3, $timeout, $sce, $rootScope) { | ||||
|   '$scope', '$q', 'Auth', 'azp@oauth3.org', '$timeout', '$sce', '$rootScope', '$location', | ||||
|   function ($scope, $q, Auth, Oauth3, $timeout, $sce, $rootScope, $location) { | ||||
| 
 | ||||
|   var vm = this; | ||||
|   var angular = window.angular; | ||||
| @ -618,11 +618,9 @@ app.controller('websiteCtrl', [ | ||||
|       token: vm.Shares.inviteToken | ||||
|     }).then(function (result) { | ||||
|       if (result.data.error) { | ||||
|         debugger; | ||||
|         var msg = result.data.error.message + '.'; | ||||
|         vm.buildNotification(result, msg); | ||||
|       } else { | ||||
|         debugger; | ||||
|         var person = result.data.comment; | ||||
|         var path = result.data.path; | ||||
|         var shareMode = result.data.mode; | ||||
| @ -631,8 +629,12 @@ app.controller('websiteCtrl', [ | ||||
|         vm.buildNotification(result, msg); | ||||
|         vm.listSites(); | ||||
|       } | ||||
|       if ($location.$$search.token) { | ||||
|         delete $location.$$search.token; | ||||
|         vm.Shares.inviteToken = ''; | ||||
|         $location.$$compose(); | ||||
|       } | ||||
|     }); | ||||
| 
 | ||||
|   }; | ||||
| 
 | ||||
|   vm.Shares.list = function (r) { | ||||
| @ -868,15 +870,7 @@ app.controller('websiteCtrl', [ | ||||
|         message: msg | ||||
|       }; | ||||
|     } | ||||
|     //Hide notification
 | ||||
|     $timeout(function() { | ||||
|       vm.alertNotification = { | ||||
|         className: '', | ||||
|         title: '', | ||||
|         hidden: 'hidden', | ||||
|         message: '' | ||||
|       }; | ||||
|     }, 7000); | ||||
|     window.scrollTo(0, 0); | ||||
|   }; | ||||
| 
 | ||||
|   vm.closeAllOpenActions = function () { | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user