Commit e5b0978
fix(settings): ensure themes UI is always up-to-date when renavigating (@byseif21) (monkeytypegame#6581)
### Description
When (changing / adding or removing themes from favorite ) via command
line or from the current theme button "in page e.g test page" and then
navigating to Settings > Themes, the UI does not immediately reflect the
current theme changes . The user has to manually refresh the page to see
these changes.
**Now**
UI automatically refreshes
to reflect the current theme selection and favorites without requiring
a manual page refresh.
- Added refreshThemeUI function in theme-picker.ts that updates all
theme-related UI components
- Called this refresh function in the settings page's beforeShow
lifecycle hook to ensure the theme UI is always up-to-date when the page
is displayed.
**FOR TESTING BEFORE & AFTER:**
keep changing themes then navigate to the settings and check and keep
doing those things again to verify that the active theme and favorites
update.
---------
Co-authored-by: Miodec <[email protected]>1 parent 21230ab commit e5b0978
File tree
3 files changed
+15
-10
lines changed- frontend/src/ts
- elements/settings
- modals
- pages
3 files changed
+15
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | | - | |
| 118 | + | |
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
214 | | - | |
| 214 | + | |
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
| |||
318 | 318 | | |
319 | 319 | | |
320 | 320 | | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
321 | 327 | | |
322 | 328 | | |
323 | 329 | | |
| |||
363 | 369 | | |
364 | 370 | | |
365 | 371 | | |
366 | | - | |
367 | 372 | | |
368 | 373 | | |
369 | 374 | | |
| |||
472 | 477 | | |
473 | 478 | | |
474 | 479 | | |
475 | | - | |
| 480 | + | |
476 | 481 | | |
477 | 482 | | |
478 | 483 | | |
479 | 484 | | |
480 | 485 | | |
481 | 486 | | |
482 | 487 | | |
483 | | - | |
| 488 | + | |
484 | 489 | | |
485 | 490 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1152 | 1152 | | |
1153 | 1153 | | |
1154 | 1154 | | |
1155 | | - | |
| 1155 | + | |
1156 | 1156 | | |
1157 | 1157 | | |
1158 | 1158 | | |
| |||
1179 | 1179 | | |
1180 | 1180 | | |
1181 | 1181 | | |
1182 | | - | |
| 1182 | + | |
1183 | 1183 | | |
1184 | 1184 | | |
1185 | 1185 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
686 | 686 | | |
687 | 687 | | |
688 | 688 | | |
689 | | - | |
690 | | - | |
| 689 | + | |
691 | 690 | | |
692 | 691 | | |
693 | 692 | | |
| |||
819 | 818 | | |
820 | 819 | | |
821 | 820 | | |
822 | | - | |
823 | 821 | | |
824 | 822 | | |
825 | 823 | | |
| |||
1271 | 1269 | | |
1272 | 1270 | | |
1273 | 1271 | | |
| 1272 | + | |
| 1273 | + | |
1274 | 1274 | | |
1275 | 1275 | | |
1276 | 1276 | | |
| |||
0 commit comments