From 6232555a75848422a8bf44aadc410c6d600ce98f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa?= Date: Fri, 23 Nov 2018 09:08:23 +0100 Subject: [PATCH] Avoid navigation on blocked projects --- app/coffee/app.coffee | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/coffee/app.coffee b/app/coffee/app.coffee index e5d66a4e..adcafa9c 100644 --- a/app/coffee/app.coffee +++ b/app/coffee/app.coffee @@ -780,7 +780,8 @@ i18nInit = (lang, $translate) -> init = ($log, $rootscope, $auth, $events, $analytics, $translate, $location, $navUrls, appMetaService, - loaderService, navigationBarService, errorHandlingService, lightboxService, $tgConfig) -> + loaderService, navigationBarService, errorHandlingService, lightboxService, $tgConfig, + projectService) -> $log.debug("Initialize application") $rootscope.$on '$translatePartialLoaderStructureChanged', () -> @@ -869,6 +870,9 @@ init = ($log, $rootscope, $auth, $events, $analytics, $translate, $location, $na $rootscope.$on '$locationChangeStart', (event) -> errorHandlingService.init() + if projectService.project?.get('blocked_code') + errorHandlingService.block() + if lightboxService.getLightboxOpen().length event.preventDefault(); @@ -1001,5 +1005,6 @@ module.run([ "tgErrorHandlingService", "lightboxService", "$tgConfig", + "tgProjectService", init ])