Skip to content

Commit

Permalink
No surveys returned for opted out users
Browse files Browse the repository at this point in the history
  • Loading branch information
eliasyishak committed May 22, 2023
1 parent 681f712 commit f6d9f8e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkgs/unified_analytics/lib/src/analytics.dart
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ abstract class Analytics {
/// run or when the message has been updated
String get getConsentMessage;

/// Returns true if it is OK to send an analytics message. Do not cache,
/// Returns true if it is OK to send an analytics message. Do not cache,
/// as this depends on factors that can change, such as the configuration
/// file contents.
bool get okToSend;
Expand Down Expand Up @@ -382,8 +382,9 @@ class AnalyticsImpl implements Analytics {
@override
Future<List<Survey>> fetchAvailableSurveys() async {
final List<Survey> surveysToShow = [];
final LogFileStats? logFileStats = _logHandler.logFileStats();
if (!okToSend) return surveysToShow;

final LogFileStats? logFileStats = _logHandler.logFileStats();
if (logFileStats == null) return [];

for (final Survey survey in await _surveyHandler.fetchSurveyList()) {
Expand Down

0 comments on commit f6d9f8e

Please sign in to comment.