fix darkmode with color picker

This commit is contained in:
SethBurkart123
2023-10-20 06:48:02 +11:00
parent e0b4a29635
commit b1c9beb3d9
3 changed files with 7 additions and 33 deletions
+6 -2
View File
@@ -13,7 +13,12 @@ let DarkMode = null;
export function updateAllColors(storedSetting, newColor = null) {
// Determine the color to use
const selectedColor = newColor || storedSetting.selectedColor;
DarkMode = storedSetting ? storedSetting.DarkMode : DarkMode;
DarkMode = (typeof storedSetting?.DarkMode === "boolean") ? storedSetting.DarkMode : DarkMode;
if (typeof storedSetting === "boolean") {
DarkMode = storedSetting;
}
// Common properties, always applied
const commonProps = {
@@ -24,7 +29,6 @@ export function updateAllColors(storedSetting, newColor = null) {
// Mode-based properties, applied if storedSetting is provided
let modeProps = {};
console.log("Darkmode: ", DarkMode);
if (DarkMode !== null) {
modeProps = DarkMode ? {
"--background-primary": "#232323",