Skip to content

Commit

Permalink
UserAgent fix (#313)
Browse files Browse the repository at this point in the history
  • Loading branch information
bsneed authored Mar 19, 2024
1 parent a59b6fe commit 63137cd
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions Sources/Segment/Plugins/Platforms/Vendors/AppleUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -249,11 +249,8 @@ internal class MacOSVendorSystem: VendorSystem {
// It has to be fetched on the main thread, so we've spun it off
// async and cache it when it comes back.
if Self.asyncUserAgent == nil {
// it's failing tests because it never comes back; they get stuck.
if isUnitTesting == false {
DispatchQueue.main.async {
Self.asyncUserAgent = WKWebView().value(forKey: "userAgent") as? String
}
DispatchQueue.main.async {
Self.asyncUserAgent = WKWebView().value(forKey: "userAgent") as? String
}
}
return Self.asyncUserAgent
Expand Down

0 comments on commit 63137cd

Please sign in to comment.