Avoid redirect on navigation

stable
Daniel García 2018-11-23 13:17:37 +01:00 committed by Alex Hermida
parent 405b922dc5
commit 606eed0528
3 changed files with 6 additions and 1 deletions

View File

@ -871,6 +871,7 @@ init = ($log, $rootscope, $auth, $events, $analytics, $translate, $location, $na
errorHandlingService.init()
if projectService.project?.get('blocked_code')
projectService.setProject(null)
errorHandlingService.block()
if lightboxService.getLightboxOpen().length

View File

@ -118,7 +118,7 @@ NavigationUrlsDirective = ($navurls, $auth, $q, $location, lightboxService, tgSe
user = $auth.getUser()
options.user = user.username if user
if options['section']
if name == 'project'
path = tgSections.getPath(options['project'], options['section'])
name = "#{name}-#{path}"

View File

@ -44,7 +44,11 @@ class SectionsService extends taiga.Service
getPath: (projectSlug, sectionId) ->
projects = @currentUserService.projects.get("all")
project = projects.find (p) -> return p.get('slug') == projectSlug
if not sectionId
sectionId = project.get('my_homepage')
section = _.find(SECTIONS, {"id": sectionId})
if !section or project?.get(section.enabled) is not true
return "timeline"