From 8f295d164348c92acbe54d807dfbc2240d53b26b Mon Sep 17 00:00:00 2001 From: Helena Rasche Date: Tue, 16 May 2023 19:25:47 +0200 Subject: [PATCH] fix var scoping --- assets/js/theme.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/assets/js/theme.js b/assets/js/theme.js index d133b0cea6c717..8fcc5177a469dd 100644 --- a/assets/js/theme.js +++ b/assets/js/theme.js @@ -42,16 +42,16 @@ if(training_theme_cookie){ } // However we have some additional things: -const currentDate = new Date(); -const currentMonth = currentDate.getMonth(); +const gtnThemeCurrentDate = new Date(); +const gtnThemeCurrentMonth = gtnThemeCurrentDate.getMonth(); -if(currentMonth === 1 && window.location.pathname === "/"){ // Just for February +if(gtnThemeCurrentMonth === 1 && window.location.pathname === "/"){ // Just for February // If the user hasn't chosen a theme if(getThemePreference() === null || getThemePreference() === "undefined" || getThemePreference() === undefined){ setTheme("blm", true); } } -else if(currentMonth === 6 && window.location.pathname === "/"){ // Just for June +else if(gtnThemeCurrentMonth === 6 && window.location.pathname === "/"){ // Just for June // If the user hasn't chosen a theme if(getThemePreference() === null || getThemePreference() === "undefined" || getThemePreference() === undefined){ setTheme("progress", true);