Skip to content

Commit c10bcfe

Browse files
committed
fix(app): update positive interaction count after eligibility check
- Move the state update after the eligibility check in the app review process - This ensures the count is only incremented if the check is successful - Prevents potential issues with out-of-sync count and app review status
1 parent b135b61 commit c10bcfe

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/app/bloc/app_bloc.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -762,11 +762,12 @@ class AppBloc extends Bloc<AppEvent, AppState> {
762762
Emitter<AppState> emit,
763763
) async {
764764
final newCount = state.positiveInteractionCount + 1;
765-
emit(state.copyWith(positiveInteractionCount: newCount));
766765
await _appReviewService.checkEligibilityAndTrigger(
767766
context: event.context,
768767
positiveInteractionCount: newCount,
769768
);
769+
// The count only updated after the eligibility check is complete.
770+
emit(state.copyWith(positiveInteractionCount: newCount));
770771
}
771772

772773
/// Handles the [AppPushNotificationTokenRefreshed] event.

0 commit comments

Comments
 (0)