Merge pull request #682 from taigaio/issue/3368/prevent-joyride-in-error-pages
prevent joyride in error pagesstable
commit
d97d1336c2
|
@ -430,7 +430,7 @@ configure = ($routeProvider, $locationProvider, $httpProvider, $provide, $tgEven
|
||||||
# Add next param when user try to access to a secction need auth permissions.
|
# Add next param when user try to access to a secction need auth permissions.
|
||||||
authHttpIntercept = ($q, $location, $navUrls, $lightboxService) ->
|
authHttpIntercept = ($q, $location, $navUrls, $lightboxService) ->
|
||||||
httpResponseError = (response) ->
|
httpResponseError = (response) ->
|
||||||
if response.status == 0
|
if response.status == 0 || response.status == -1
|
||||||
$lightboxService.closeAll()
|
$lightboxService.closeAll()
|
||||||
$location.path($navUrls.resolve("error"))
|
$location.path($navUrls.resolve("error"))
|
||||||
$location.replace()
|
$location.replace()
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
taiga = @.taiga
|
taiga = @.taiga
|
||||||
|
|
||||||
JoyRideDirective = ($rootScope, currentUserService, joyRideService) ->
|
JoyRideDirective = ($rootScope, currentUserService, joyRideService, $location) ->
|
||||||
link = (scope, el, attrs, ctrl) ->
|
link = (scope, el, attrs, ctrl) ->
|
||||||
intro = introJs()
|
intro = introJs()
|
||||||
|
|
||||||
|
@ -30,7 +30,9 @@ JoyRideDirective = ($rootScope, currentUserService, joyRideService) ->
|
||||||
intro.start()
|
intro.start()
|
||||||
|
|
||||||
$rootScope.$on '$routeChangeSuccess', (event, next) ->
|
$rootScope.$on '$routeChangeSuccess', (event, next) ->
|
||||||
return if !next.joyride || !currentUserService.isAuthenticated()
|
return if !next.joyride ||
|
||||||
|
!currentUserService.isAuthenticated() ||
|
||||||
|
$location.path() == '/error'
|
||||||
|
|
||||||
intro.oncomplete () ->
|
intro.oncomplete () ->
|
||||||
currentUserService.disableJoyRide(next.joyride)
|
currentUserService.disableJoyRide(next.joyride)
|
||||||
|
@ -53,7 +55,8 @@ JoyRideDirective = ($rootScope, currentUserService, joyRideService) ->
|
||||||
JoyRideDirective.$inject = [
|
JoyRideDirective.$inject = [
|
||||||
"$rootScope",
|
"$rootScope",
|
||||||
"tgCurrentUserService",
|
"tgCurrentUserService",
|
||||||
"tgJoyRideService"
|
"tgJoyRideService",
|
||||||
|
"$location"
|
||||||
]
|
]
|
||||||
|
|
||||||
angular.module("taigaComponents").directive("tgJoyRide", JoyRideDirective)
|
angular.module("taigaComponents").directive("tgJoyRide", JoyRideDirective)
|
||||||
|
|
Loading…
Reference in New Issue