client: Fix color theme leak when deactivating highlighting

pull/526/head
Elian Doran 2024-10-31 21:45:06 +07:00
parent c3e10b2b76
commit 4d783f1879
No known key found for this signature in database
1 changed files with 10 additions and 1 deletions

@ -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;
}