Avoid redirect on navigation
parent
405b922dc5
commit
606eed0528
|
@ -871,6 +871,7 @@ init = ($log, $rootscope, $auth, $events, $analytics, $translate, $location, $na
|
||||||
errorHandlingService.init()
|
errorHandlingService.init()
|
||||||
|
|
||||||
if projectService.project?.get('blocked_code')
|
if projectService.project?.get('blocked_code')
|
||||||
|
projectService.setProject(null)
|
||||||
errorHandlingService.block()
|
errorHandlingService.block()
|
||||||
|
|
||||||
if lightboxService.getLightboxOpen().length
|
if lightboxService.getLightboxOpen().length
|
||||||
|
|
|
@ -118,7 +118,7 @@ NavigationUrlsDirective = ($navurls, $auth, $q, $location, lightboxService, tgSe
|
||||||
user = $auth.getUser()
|
user = $auth.getUser()
|
||||||
options.user = user.username if user
|
options.user = user.username if user
|
||||||
|
|
||||||
if options['section']
|
if name == 'project'
|
||||||
path = tgSections.getPath(options['project'], options['section'])
|
path = tgSections.getPath(options['project'], options['section'])
|
||||||
name = "#{name}-#{path}"
|
name = "#{name}-#{path}"
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,11 @@ class SectionsService extends taiga.Service
|
||||||
getPath: (projectSlug, sectionId) ->
|
getPath: (projectSlug, sectionId) ->
|
||||||
projects = @currentUserService.projects.get("all")
|
projects = @currentUserService.projects.get("all")
|
||||||
project = projects.find (p) -> return p.get('slug') == projectSlug
|
project = projects.find (p) -> return p.get('slug') == projectSlug
|
||||||
|
|
||||||
|
if not sectionId
|
||||||
|
sectionId = project.get('my_homepage')
|
||||||
section = _.find(SECTIONS, {"id": sectionId})
|
section = _.find(SECTIONS, {"id": sectionId})
|
||||||
|
|
||||||
if !section or project?.get(section.enabled) is not true
|
if !section or project?.get(section.enabled) is not true
|
||||||
return "timeline"
|
return "timeline"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue