mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Handle unset editor theme (#12892)
GitOrigin-RevId: 0e3413c08c6fd0752cd90ee868fec9b0f9f77437
This commit is contained in:
parent
2796f750ee
commit
b010d6a5d3
1 changed files with 4 additions and 0 deletions
|
@ -243,6 +243,10 @@ const staticTheme = EditorView.theme({
|
||||||
})
|
})
|
||||||
|
|
||||||
const loadSelectedTheme = async (editorTheme: string) => {
|
const loadSelectedTheme = async (editorTheme: string) => {
|
||||||
|
if (!editorTheme) {
|
||||||
|
editorTheme = 'textmate' // use the default theme if unset
|
||||||
|
}
|
||||||
|
|
||||||
const { theme, highlightStyle, dark } = await import(
|
const { theme, highlightStyle, dark } = await import(
|
||||||
/* webpackChunkName: "cm6-theme" */ `../themes/cm6/${editorTheme}.json`
|
/* webpackChunkName: "cm6-theme" */ `../themes/cm6/${editorTheme}.json`
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue