From 92dc3b0af4cfe54d1ddc165975808f011cad40ce Mon Sep 17 00:00:00 2001 From: Maxime Epain Date: Tue, 9 Apr 2024 16:13:10 +0200 Subject: [PATCH] Apply suggestions from code review --- .../Sources/WebViewTracking.swift | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/DatadogWebViewTracking/Sources/WebViewTracking.swift b/DatadogWebViewTracking/Sources/WebViewTracking.swift index ad5724a96d..764084ab14 100644 --- a/DatadogWebViewTracking/Sources/WebViewTracking.swift +++ b/DatadogWebViewTracking/Sources/WebViewTracking.swift @@ -143,19 +143,8 @@ public enum WebViewTracking { let privacyLevel = sessionReplayConfiguration?.privacyLevel ?? .mask // Share native capabilities with Browser SDK - let capabilities: String = { - var capabilities: [String] = [] - - // Add 'records' capability when session-replay - // is configured. - if sessionReplayConfiguration != nil { - capabilities.append("records") - } - - return capabilities - .map { return "\"\($0)\"" } - .joined(separator: ",") - }() + // Share native capabilities with Browser SDK + let capabilities = sessionReplayConfiguration != nil ? "\"records\"" : "" let js = """ \(Self.jsCodePrefix)