Skip to content

Commit

Permalink
fix var scoping
Browse files Browse the repository at this point in the history
  • Loading branch information
hexylena committed May 16, 2023
1 parent 8a3866f commit 8f295d1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions assets/js/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 8f295d1

Please sign in to comment.