Skip to content

Commit 7d4dcc8

Browse files
committed
fix: apply Monaco editor theme on initial load
1 parent fd8f848 commit 7d4dcc8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ui/src/components/editor.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ export const Editor: FunctionComponent<Props> = ({ value, onChange }) => {
4343

4444
monacoInstance.editor.defineTheme("sql-dark", vsPlusTheme.darkThemeData);
4545
monacoInstance.editor.defineTheme("sql-light", vsPlusTheme.lightThemeData);
46-
}, [monacoInstance]);
46+
monacoInstance.editor.setTheme(
47+
currentTheme === "light" ? "sql-light" : "sql-dark",
48+
);
49+
}, [monacoInstance, currentTheme]);
4750

4851
// Register completion provider
4952
useEffect(() => {

0 commit comments

Comments
 (0)