Fix main content not always dimmed when a curtain is open.
This commit is contained in:
parent
cc3e292f40
commit
86e4c5aff2
1 changed files with 3 additions and 2 deletions
|
@ -175,9 +175,10 @@ export function CurtainsProvider({children}: React.PropsWithChildren<{}>)
|
|||
useEffect(() => {
|
||||
if (
|
||||
Object.keys(curtains).filter((curtainId) => !closedCurtains[curtainId]).length > 0
|
||||
&& !document.body.classList.contains("dimmed")
|
||||
) // We should dim content if there is at least one open curtain.
|
||||
document.body.classList.add("dimmed");
|
||||
{ // Only dim if it's not already dimmed.
|
||||
if (!document.body.classList.contains("dimmed")) document.body.classList.add("dimmed");
|
||||
}
|
||||
else
|
||||
// We shouldn't dim content.
|
||||
document.body.classList.remove("dimmed");
|
||||
|
|
Loading…
Reference in a new issue