Skip to content

Commit 0600b25

Browse files
authored
fix(settings page): ui not updating on favorite themes change via commandline (@byseif21) (monkeytypegame#6567)
### Description When using the command line to add or remove a theme from favorites while on the settings page, the favorites UI would not reflect the changes until the user manually refreshed the page or changed the theme. This caused confusion, despite the changes being correctly saved in the config. **Solution** Added a ConfigEvent subscription in theme-picker.ts to listen for "favThemes" updates. If the active page is "settings", the UI is now refreshed immediately by calling refreshPresetButtons().
1 parent 04fbd81 commit 0600b25

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

frontend/src/ts/elements/settings/theme-picker.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,4 +480,7 @@ ConfigEvent.subscribe((eventKey) => {
480480
if (eventKey === "theme" && ActivePage.get() === "settings") {
481481
updateActiveButton();
482482
}
483+
if (eventKey === "favThemes" && ActivePage.get() === "settings") {
484+
void refreshPresetButtons();
485+
}
483486
});

0 commit comments

Comments
 (0)