From 08b5a0da817355cce1f73ba86f111a9f36f69165 Mon Sep 17 00:00:00 2001
From: Emmanuel Ormancey <emmanuel.ormancey@cern.ch>
Date: Mon, 30 Oct 2023 12:36:31 +0100
Subject: [PATCH] [HOTFIX][#247] no preferences warning always displays after
 login to site

---
 src/common/components/InformationBar/InformationBar.js | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/common/components/InformationBar/InformationBar.js b/src/common/components/InformationBar/InformationBar.js
index 111e5e84..c2bcd95c 100644
--- a/src/common/components/InformationBar/InformationBar.js
+++ b/src/common/components/InformationBar/InformationBar.js
@@ -20,7 +20,11 @@ function InformationBar({
   useEffect(() => {
     getServiceStatus();
     // Avoid race problem with channel getPreference and avoid duplicate global getPrefereces call
-    if (preferences.global.length === 0 && !window.location.pathname.startsWith('/channels')) {
+    if (
+      isAuthenticated &&
+      preferences.global.length === 0 &&
+      !window.location.pathname.startsWith('/channels')
+    ) {
       getPreferences(null, true);
     }
     // eslint-disable-next-line react-hooks/exhaustive-deps
-- 
GitLab