Skip to content

Commit

Permalink
fixing the theme
Browse files Browse the repository at this point in the history
  • Loading branch information
invisal committed Feb 3, 2025
1 parent 3ab4e32 commit 03899fd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/components/gui/json-editor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ interface JsonEditorProps {
}

function useJsonTheme() {
const { resolvedTheme } = useTheme();
const { resolvedTheme, forcedTheme } = useTheme();

return useMemo(() => {
if (resolvedTheme === "light") {
if ((forcedTheme ?? resolvedTheme) === "light") {
return createTheme({
theme: "light",
settings: {
Expand Down Expand Up @@ -69,7 +69,7 @@ function useJsonTheme() {
],
});
}
}, [resolvedTheme]);
}, [resolvedTheme, forcedTheme]);
}

const JsonEditor = forwardRef<ReactCodeMirrorRef, JsonEditorProps>(
Expand Down
6 changes: 3 additions & 3 deletions src/components/gui/sql-editor/use-editor-theme.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ export default function useCodeEditorTheme({
}: {
fontSize?: number;
}) {
const { resolvedTheme } = useTheme();
const { resolvedTheme, forcedTheme } = useTheme();

return useMemo(() => {
if (resolvedTheme === "light") {
if ((forcedTheme ?? resolvedTheme) === "light") {
return createTheme({
theme: "light",
settings: {
Expand Down Expand Up @@ -73,5 +73,5 @@ export default function useCodeEditorTheme({
],
});
}
}, [resolvedTheme, fontSize]);
}, [resolvedTheme, forcedTheme, fontSize]);
}

0 comments on commit 03899fd

Please sign in to comment.