Skip to content

Build your personal knowledge base with Trilium Notes

client: Fix color theme leak when deactivating highlighting

Elian Doran4d783f187916
diff --git a/src/public/app/services/library_loader.js b/src/public/app/services/library_loader.js
index a6b7700384..f5299ae331 100644
--- a/src/public/app/services/library_loader.js
+++ b/src/public/app/services/library_loader.js
@@ -158,7 +158,16 @@ async function requireCss(url, prependAssetPath = true) {
let highlightingThemeEl = null;
function loadHighlightingTheme(theme) {
- if (!theme) {
+ if (!theme) {
+ return;
+ }
+
+ if (theme === "none") {
+ // Deactivate the theme.
+ if (highlightingThemeEl) {
+ highlightingThemeEl.remove();
+ highlightingThemeEl = null;
+ }
return;
}