Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
fix(options/text): changing light/dark theme doesn't react immediately
Elian Doran4aefedd1d7b5
diff --git a/apps/client/src/widgets/type_widgets/options/text_notes.tsx b/apps/client/src/widgets/type_widgets/options/text_notes.tsxindex 928d1004f7..ce57c8814e 100644--- a/apps/client/src/widgets/type_widgets/options/text_notes.tsx+++ b/apps/client/src/widgets/type_widgets/options/text_notes.tsx@@ -9,8 +9,8 @@ import { isExperimentalFeatureEnabled } from "../../../services/experimental_feaimport { t } from "../../../services/i18n";import { ensureMimeTypesForHighlighting, loadHighlightingTheme } from "../../../services/syntax_highlight";import { formatDateTime, toggleBodyClass } from "../../../services/utils";-import FormGroup from "../../react/FormGroup";import Dropdown from "../../react/Dropdown";+import FormGroup from "../../react/FormGroup";import { FormListItem } from "../../react/FormList";import FormSelect, { FormSelectGroup, FormSelectWithGroups } from "../../react/FormSelect";import FormText from "../../react/FormText";@@ -282,8 +282,11 @@ function CodeBlockStyle() {? (colorScheme === "dark" ? darkTheme : lightTheme): codeBlockTheme;+ useEffect(() => {+ loadHighlightingTheme(effectiveTheme);+ }, [effectiveTheme]);+const onThemeChange = (newTheme: string) => {- loadHighlightingTheme(newTheme);setCodeBlockTheme(newTheme);};