From 47d7c6e8d78a3617a57e1f081b6411f5b17b47a0 Mon Sep 17 00:00:00 2001 From: aynsix Date: Mon, 11 Oct 2021 15:58:44 +0300 Subject: [PATCH] PHRAS-3528 fix download zip loop --- templates/web/common/menubar.html.twig | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/templates/web/common/menubar.html.twig b/templates/web/common/menubar.html.twig index d8021de270..cc528743eb 100644 --- a/templates/web/common/menubar.html.twig +++ b/templates/web/common/menubar.html.twig @@ -416,10 +416,13 @@ }); }); - /**manage session and redirect to login page**/ - var usr_id = '{{ app.getAuthenticator().user.getId }}'; - var module = '{{ module }}'; + // no need to launch pollNotifications if not connected on load page + {% if app.getAuthenticator().isAuthenticated() %} + /**manage session and redirect to login page**/ + var usr_id = '{{ app.getAuthenticator().user.getId }}'; + var module = '{{ module }}'; - // start pooling recursively - window.setTimeout( function() { commonModule.pollNotifications(usr_id, module === 'prod', true); }, 2000); + // start pooling recursively + window.setTimeout( function() { commonModule.pollNotifications(usr_id, module === 'prod', true); }, 2000); + {% endif %}