Commit 630bd20
committed
fix: Initialize animatedOnlineCount when view appears with stats
Problem:
- In v1.1.4, online count always shows as 0
- animatedOnlineCount is initialized to 0 as default
- When onlineStats changes from nil to a value, animatedOnlineCount stays at 0
- onChange only triggers when the value changes, not on initial load
Solution:
- Add onAppear to initialize animatedOnlineCount from stats.onlineCount
- Check if animatedOnlineCount is 0 and stats has valid count
- This ensures the count displays correctly on first load
Fixes the regression introduced in PR #57 where animated count feature
broke the initial display of online user count.1 parent 5a207d5 commit 630bd20
1 file changed
+6
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
61 | 67 | | |
62 | 68 | | |
63 | 69 | | |
| |||
0 commit comments