Skip to content

Commit a52e0e9

Browse files
committed
bfix: acceptance graph updating correctly
- Acceptance graph updates on changing user profile - Acceptance graph now clears before being fetched again
1 parent 2acf10b commit a52e0e9

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

lib/presentation/profile/bloc/profile_bloc.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ class ProfileBloc extends Bloc<ProfileEvent, ProfileState> {
5353
return;
5454
}
5555

56+
_activity.clear();
5657
for (final activity in activityDetails ?? <ActivityDetails>[]) {
5758
if (activity.createdAt == null) continue;
5859
_activity[activity.createdAt!] = activity.correct;

lib/presentation/profile/widgets/acceptance_graph.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,13 @@ class AcceptanceGraph extends StatelessWidget {
1515
return BlocBuilder<ProfileBloc, ProfileState>(
1616
buildWhen: (previous, current) {
1717
return (previous.currentYear != current.currentYear) ||
18-
(previous.currentTriplet != current.currentTriplet);
18+
(previous.currentTriplet != current.currentTriplet) ||
19+
(previous.user != current.user);
1920
},
2021
builder: (context, state) {
22+
print("Acceptance Graph Build");
2123
final bloc = context.read<ProfileBloc>();
24+
print(bloc.state.user);
2225
var day = 0;
2326

2427
final firstWeekDay = util.DateUtils.fistDayofMonth(

0 commit comments

Comments
 (0)