diff --git a/Plan/common/src/main/resources/assets/plan/web/js/color-selector.js b/Plan/common/src/main/resources/assets/plan/web/js/color-selector.js index 2cdd50f22..355bab248 100644 --- a/Plan/common/src/main/resources/assets/plan/web/js/color-selector.js +++ b/Plan/common/src/main/resources/assets/plan/web/js/color-selector.js @@ -10,15 +10,14 @@ 'brown', 'grey', 'blue-grey']; const selectedColor = window.localStorage.getItem('themeColor'); - const themeDefaultColor = 'plan'; + const themeDefaultColor = '${defaultTheme}'; let currentColor = 'plan'; - if (selectedColor === null) { - window.localStorage.setItem('themeColor', currentColor); - } - // Function for changing color function setColor(nextColor) { + if (selectedColor === null) { + window.localStorage.setItem('themeColor', currentColor); + } $('body').removeClass('theme-' + currentColor).addClass('theme-' + nextColor); if (!nextColor || nextColor == currentColor) { return; @@ -71,7 +70,7 @@ // Change the color of the theme setColor(selectedColor ? selectedColor : themeDefaultColor); - let nightMode = window.localStorage.getItem('nightMode') == 'true'; + let nightMode = window.localStorage.getItem('nightMode') == 'true' || '${defaultTheme}' == 'night'; const saturationReduction = 0.70;