Merge pull request #29899 from overleaf/mj-dark-mode-file-flash

[web] Avoid background color flash when switching files

GitOrigin-RevId: e5d2fbb631fd54d195b9cb51b2a9db584d205138
This commit is contained in:
Mathias Jakobsen
2025-11-28 09:05:18 +00:00
committed by Copybot
parent ff5b469b20
commit 7c1a225be4
15 changed files with 145 additions and 85 deletions
@@ -287,7 +287,8 @@ const loadSelectedTheme = async (editorTheme: string) => {
const themes = getMeta('ol-editorThemes') || []
const legacyThemes = getMeta('ol-legacyEditorThemes') || []
const themeExists =
themes.includes(editorTheme) || legacyThemes.includes(editorTheme)
themes.some(theme => theme.name === editorTheme) ||
legacyThemes.some(theme => theme.name === editorTheme)
if (!themeExists) {
editorTheme = 'textmate' // fallback to default if the theme is not found
}