Skip to content

Commit

Permalink
Fix #6392: Move openTabCount telemetry to core ping
Browse files Browse the repository at this point in the history
  • Loading branch information
dnarcese committed Apr 9, 2020
1 parent 0170f5f commit ca632b8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Client/Telemetry/UnifiedTelemetry.swift
Expand Up @@ -91,6 +91,10 @@ class UnifiedTelemetry {

outputDict["settings"] = settings

let delegate = UIApplication.shared.delegate as? AppDelegate

outputDict["openTabCount"] = delegate?.tabManager.count ?? 0

var userInterfaceStyle = "unknown" // unknown implies that device is on pre-iOS 13
if #available(iOS 13.0, *) {
userInterfaceStyle = UITraitCollection.current.userInterfaceStyle == .dark ? "dark" : "light"
Expand All @@ -115,10 +119,6 @@ class UnifiedTelemetry {

outputDict["settings"] = settings

let delegate = UIApplication.shared.delegate as? AppDelegate

outputDict["openTabCount"] = delegate?.tabManager.count ?? 0

// App Extension telemetry requires reading events stored in prefs, then clearing them from prefs.
if let extensionEvents = profile.prefs.arrayForKey(PrefsKeys.AppExtensionTelemetryEventArray) as? [[String: String]],
var pingEvents = outputDict["events"] as? [[Any?]] {
Expand Down

0 comments on commit ca632b8

Please sign in to comment.