From 2f526c9f0b33981512cfe66e65011e2b067ff97b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Est=C3=AAv=C3=A3o?= Date: Fri, 22 Nov 2024 20:19:27 +0000 Subject: [PATCH 1/2] Insert a note to the support ticket to indicate logs are attached to make automation better on server side --- podcasts/Zendesk/MessageSupportViewModel.swift | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/podcasts/Zendesk/MessageSupportViewModel.swift b/podcasts/Zendesk/MessageSupportViewModel.swift index 5eaf726805..b8072c735b 100644 --- a/podcasts/Zendesk/MessageSupportViewModel.swift +++ b/podcasts/Zendesk/MessageSupportViewModel.swift @@ -142,10 +142,16 @@ class MessageSupportViewModel: ObservableObject { if containsWatch && customFields.first(where: { $0.value.contains(FileLog.noWearableLogsAvailable) }) != nil && !ignoreUnavailableWatchLogs { return Fail(error: MessageSupportFailure.watchLogMissing).eraseToAnyPublisher() } else { + let hasLogs = customFields.contains(where: { $0.id == SupportCustomField.debugLog.rawValue }) + var extraText = "" + if hasLogs { + extraText = "\n\nNote: Logs Attached" + } + let requestObject = ZDSupportRequest(subject: self.config.subject, name: self.requesterName, email: self.requesterEmail, - comment: self.comment, + comment: self.comment + extraText, customFields: customFields, tags: self.config.tags) From c898073d19ee27bcf641749f84a075370cba3ae9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Est=C3=AAv=C3=A3o?= Date: Fri, 22 Nov 2024 20:34:30 +0000 Subject: [PATCH 2/2] Chek if no logs are attached --- podcasts/Zendesk/MessageSupportViewModel.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/podcasts/Zendesk/MessageSupportViewModel.swift b/podcasts/Zendesk/MessageSupportViewModel.swift index b8072c735b..69f3ec1f2d 100644 --- a/podcasts/Zendesk/MessageSupportViewModel.swift +++ b/podcasts/Zendesk/MessageSupportViewModel.swift @@ -142,7 +142,7 @@ class MessageSupportViewModel: ObservableObject { if containsWatch && customFields.first(where: { $0.value.contains(FileLog.noWearableLogsAvailable) }) != nil && !ignoreUnavailableWatchLogs { return Fail(error: MessageSupportFailure.watchLogMissing).eraseToAnyPublisher() } else { - let hasLogs = customFields.contains(where: { $0.id == SupportCustomField.debugLog.rawValue }) + let hasLogs = customFields.contains(where: { $0.id == SupportCustomField.debugLog.rawValue && !$0.value.hasSuffix("User opted out")}) var extraText = "" if hasLogs { extraText = "\n\nNote: Logs Attached"