Skip to content

Commit d67f813

Browse files
committed
fix: add useEffect cleanup function
1 parent bafc676 commit d67f813

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

site/src/contexts/ThemeProvider.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,16 @@ export const ThemeProvider: FC<PropsWithChildren> = ({ children }) => {
6060

6161
useEffect(() => {
6262
const root = document.documentElement;
63-
root.classList.remove("light", "dark");
63+
6464
if (themePreference === "auto") {
6565
root.classList.add(preferredColorScheme);
6666
} else {
6767
root.classList.add(themePreference);
6868
}
69+
70+
return () => {
71+
root.classList.remove("light", "dark");
72+
};
6973
}, [themePreference, preferredColorScheme]);
7074

7175
const theme =
@@ -79,6 +83,7 @@ export const ThemeProvider: FC<PropsWithChildren> = ({ children }) => {
7983
);
8084
};
8185

86+
// This is being added to allow Tailwind and MUI to work together.
8287
const cache = createCache({
8388
key: "css",
8489
prepend: true,

site/src/pages/DeploymentSettingsPage/PremiumPage/PremiumPageView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const EnterpriseVersion: FC = () => {
1818
<p className="text-sm max-w-xl mt-2 text-content-secondary font-medium">
1919
As an Enterprise license holder, you already benefit from Coder’s
2020
features for secure, large-scale deployments. Upgrade to Coder
21-
Premium for enhanced multi-tenant control and flexibility:
21+
Premium for enhanced multi-tenant control and flexibility.
2222
</p>
2323
</div>
2424
<Button asChild>

0 commit comments

Comments
 (0)