fix(theme-constroller): fix theme flashing behavior when switching custom themes in apply() (@raaid3) (#6670)

### Description

Closes [#6669](https://github.com/monkeytypegame/monkeytype/issues/6669)

<!-- the issue(s) your PR resolves if any (delete if that is not the
case) -->
<!-- please also reference any issues and or PRs related to your pull
request -->
<!-- Also remove it if you are not following any issues. -->

<!-- pro tip: you can mention an issue, PR, or discussion on GitHub by
referencing its hash number e.g:
[#1234](https://github.com/monkeytypegame/monkeytype/pull/1234) -->

<!-- pro tip: you can press . (dot or period) in the code tab of any
GitHub repo to get access to GitHub's VS Code web editor Enjoy! :) -->
This commit is contained in:
Dhyan Rai 2025-06-27 13:34:45 -04:00 committed by GitHub
parent 83a34c64d7
commit fdead53ba9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -153,7 +153,9 @@ async function apply(
customColorsOverride,
isPreview
);
clearCustomTheme();
if (!Config.customTheme) {
clearCustomTheme();
}
const name = customColorsOverride ? "custom" : themeName;
ThemeColors.reset();