Skip to content

Commit

Permalink
Fix window opacity bug
Browse files Browse the repository at this point in the history
  • Loading branch information
esimkowitz committed Nov 14, 2024
1 parent 14249b3 commit b8a45ea
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions frontend/app/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ function AppSettingsUpdater() {
(windowSettings?.["window:transparent"] || windowSettings?.["window:blur"]) ?? false;
const opacity = util.boundNumber(windowSettings?.["window:opacity"] ?? 0.8, 0, 1);
let baseBgColor = windowSettings?.["window:bgcolor"];
let mainDiv = document.getElementById("main");
const mainDiv = document.getElementById("main");
// console.log("window settings", windowSettings, isTransparentOrBlur, opacity, baseBgColor, mainDiv);
if (isTransparentOrBlur) {
mainDiv.classList.add("is-transparent");
Expand All @@ -131,10 +131,10 @@ function AppSettingsUpdater() {
}
const color = new Color(baseBgColor);
const rgbaColor = color.alpha(opacity).string();
mainDiv.style.backgroundColor = rgbaColor;
document.body.style.backgroundColor = rgbaColor;
} else {
mainDiv.classList.remove("is-transparent");
mainDiv.style.opacity = null;
document.body.style.backgroundColor = "var(--main-bg-color)";
}
}, [windowSettings]);
return null;
Expand Down

0 comments on commit b8a45ea

Please sign in to comment.