Skip to content

Commit 24beebf

Browse files
committed
Check for telemetry status after saving locally
1 parent a53933c commit 24beebf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkgs/dash_analytics/lib/src/analytics.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,6 @@ class AnalyticsImpl implements Analytics {
245245
required DashEvent eventName,
246246
Map<String, Object?> eventData = const {},
247247
}) {
248-
if (!telemetryEnabled) return null;
249-
250248
// Construct the body of the request
251249
final Map<String, Object?> body = generateRequestBody(
252250
clientId: _clientId,
@@ -257,6 +255,8 @@ class AnalyticsImpl implements Analytics {
257255

258256
_logHandler.save(data: body);
259257

258+
if (!telemetryEnabled) return null;
259+
260260
// Pass to the google analytics client to send
261261
return _gaClient.sendData(body);
262262
}

0 commit comments

Comments
 (0)