Commit ba115c7
fix: mobile discussion total post count not updating on reply (#4684)
The scrubber's "viewing X of Y" label was built once as a vnode tree
and rendered in two places (the dropdown toggle and the Scrubber-info
strong). Reusing a single vnode instance in two positions breaks
Mithril's diffing, leaving one copy stale on redraw.
The current post index is force-written to the DOM via jQuery on
scroll, so it always updated; the total count is only rendered through
Mithril's view, so the stale copy (the dropdown toggle shown in the
mobile header) never refreshed after posting a reply.
Build the label as a function that returns a fresh vnode tree per
usage so both render sites diff correctly.
Backport fix #4678
Co-authored-by: IanM <16573496+imorland@users.noreply.github.com>1 parent 4ecf267 commit ba115c7
1 file changed
Lines changed: 12 additions & 8 deletions
Lines changed: 12 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
35 | 39 | | |
36 | 40 | | |
37 | 41 | | |
| |||
58 | 62 | | |
59 | 63 | | |
60 | 64 | | |
61 | | - | |
| 65 | + | |
62 | 66 | | |
63 | 67 | | |
64 | 68 | | |
| |||
72 | 76 | | |
73 | 77 | | |
74 | 78 | | |
75 | | - | |
| 79 | + | |
76 | 80 | | |
77 | 81 | | |
78 | 82 | | |
| |||
0 commit comments