Skip to content

Commit b11fe91

Browse files
committed
fix: reflect completion status on daily_challenge_view correctly
1 parent 517cf1d commit b11fe91

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

mobile-app/lib/ui/views/learn/daily_challenge/daily_challenge_viewmodel.dart

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,19 @@ class DailyChallengeViewModel extends BaseViewModel {
2222

2323
Future<void> init() async {
2424
await _fetchAndGroupChallenges();
25+
_initAuthenticationListener();
26+
}
27+
28+
void _initAuthenticationListener() {
29+
// Listen to authentication state changes to refresh completion status
30+
_auth.isLoggedIn.listen((isLoggedIn) async {
31+
notifyListeners();
32+
});
33+
34+
// Also listen to progress stream for user data updates
35+
_auth.progress.stream.listen((_) {
36+
notifyListeners();
37+
});
2538
}
2639

2740
void toggleBlock(String monthYear) {

0 commit comments

Comments
 (0)