mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-06 05:26:54 +08:00
fix(settings page): ui not updating on favorite themes change via commandline (@byseif21) (#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().
This commit is contained in:
parent
04fbd81c10
commit
0600b25cda
1 changed files with 3 additions and 0 deletions
|
@ -480,4 +480,7 @@ ConfigEvent.subscribe((eventKey) => {
|
|||
if (eventKey === "theme" && ActivePage.get() === "settings") {
|
||||
updateActiveButton();
|
||||
}
|
||||
if (eventKey === "favThemes" && ActivePage.get() === "settings") {
|
||||
void refreshPresetButtons();
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue