Skip to content

Commit 64473e4

Browse files
authored
fix(commandline): prevent false theme apply during perview (@byseif21) (monkeytypegame#6930)
* When leaving a theme item to a non‑theme item inside the mixed commandline list, the preview theme temporarily applied after closing the commandline without selecting it. so switched back to clearPreview() as it was, #### to REPRODUCE: type e.g "theme off" in the commandline then close the commandline. * and to fix the preview flashing issue that the false was added for, in custom themes included setCustomThemeId with changeTheme in the check , so custom theme hovers are now treated as the same preview context and no longer clear the preview between items.
1 parent 56b25f3 commit 64473e4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

frontend/src/ts/commandline/commandline.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -564,10 +564,13 @@ async function updateActiveCommand(): Promise<void> {
564564
keepActiveCommandInView();
565565

566566
clearFontPreview();
567-
if (/changeTheme.+/gi.test(command.id)) {
567+
if (
568+
command.id?.startsWith("changeTheme") ||
569+
command.id?.startsWith("setCustomThemeId")
570+
) {
568571
removeCommandlineBackground();
569572
} else {
570-
void ThemeController.clearPreview(false);
573+
void ThemeController.clearPreview();
571574
addCommandlineBackground();
572575
}
573576

0 commit comments

Comments
 (0)