From 97d395fb0ef21ab77941e30e253897d59bec7a11 Mon Sep 17 00:00:00 2001
From: Patrick Tang <36460266+patricksptang@users.noreply.github.com>
Date: Sun, 24 Nov 2024 22:44:19 -0800
Subject: [PATCH] Check ICC announcement is shown

---
 step-web/src/main/webapp/js/step_ready.js | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/step-web/src/main/webapp/js/step_ready.js b/step-web/src/main/webapp/js/step_ready.js
index c2123fec94..10fce661f9 100644
--- a/step-web/src/main/webapp/js/step_ready.js
+++ b/step-web/src/main/webapp/js/step_ready.js
@@ -324,8 +324,11 @@
         var stepUsageCountStorageOrCookie = step.util.localStorageGetItem("step.usageCount");
         var stepUsageCount = parseInt(stepUsageCountStorageOrCookie, 10);
         if (isNaN(stepUsageCount)) stepUsageCount = 0;
+        var stepICCAnnounceStorageOrCookie = step.util.localStorageGetItem("step.showICCAnnounce");
+        var stepICCAnnounceCount = parseInt(stepICCAnnounceStorageOrCookie, 10);
+        if (isNaN(stepICCAnnounceCount)) stepICCAnnounceCount = 0;
         var urlVars = $.getUrlVars();
-        if ((urlVars.indexOf("skipwelcome") > -1) || (urlVars.indexOf("clickvocab") > -1) || (stepUsageCount > 30) ||
+        if ( (((urlVars.indexOf("skipwelcome") > -1) || (urlVars.indexOf("clickvocab") > -1) || (stepUsageCount > 30)) && (stepICCAnnounceCount > 0)) ||
             (step.touchDevice && !step.touchWideDevice) ) { // phones do not have the width to display the Welcome to STEP panel
             step.util.showOrHideTutorial('true'); // URL has skipwelcome
             if (urlVars.indexOf("clickvocab") > -1) {
@@ -342,7 +345,8 @@
 		}
 		stepUsageCount ++;
 		step.util.localStorageSetItem("step.usageCount", stepUsageCount);
-
+        stepICCAnnounceCount ++;
+		step.util.localStorageSetItem("step.showICCAnnounce", stepICCAnnounceCount);
         $("#stepDisclaimer").popover();
     }