Skip to content

Commit

Permalink
Prevent duplicate reporting on VPN feedback form (#2511)
Browse files Browse the repository at this point in the history
  • Loading branch information
quanganhdo authored Feb 28, 2024
1 parent ef55257 commit 0bf3e8f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 26 deletions.
16 changes: 3 additions & 13 deletions DuckDuckGo/Feedback/VPNFeedbackFormView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ struct VPNFeedbackFormCategoryView: View {
struct VPNFeedbackFormView: View {
@ObservedObject var viewModel: VPNFeedbackFormViewModel
@Environment(\.dismiss) private var dismiss
@State private var showsError = false
@FocusState private var isTextEditorFocused: Bool

var onDismiss: () -> Void
Expand All @@ -90,11 +89,6 @@ struct VPNFeedbackFormView: View {
configuredForm()
.applyBackground()
.navigationTitle(UserText.netPStatusViewShareFeedback)
.alert(isPresented: $showsError) {
Alert(title: Text(UserText.vpnFeedbackFormErrorTitle),
message: Text(UserText.vpnFeedbackFormErrorMessage),
dismissButton: .default(Text(UserText.vpnFeedbackFormErrorAction)))
}
}

@ViewBuilder
Expand Down Expand Up @@ -204,14 +198,10 @@ struct VPNFeedbackFormView: View {
private func submitButton() -> some View {
Button {
Task {
let success = await viewModel.process()
if success {
dismiss()
onDismiss()
} else {
showsError = true
}
_ = await viewModel.process()
}
dismiss()
onDismiss()
} label: {
Text(UserText.vpnFeedbackFormButtonSubmit)
.daxButton()
Expand Down
3 changes: 0 additions & 3 deletions DuckDuckGo/UserText.swift
Original file line number Diff line number Diff line change
Expand Up @@ -657,9 +657,6 @@ In addition to the details entered into this form, your app issue report will co
static let vpnFeedbackFormButtonSubmitting = NSLocalizedString("vpn.feedback-form.button.submitting", value: "Submitting…", comment: "Title for the Submitting state of the VPN feedback form")

static let vpnFeedbackFormSubmittedMessage = NSLocalizedString("vpn.feedback-form.submitted.message", value: "Thank You! Feedback submitted.", comment: "Toast message when the VPN feedback form is submitted successfully")
static let vpnFeedbackFormErrorTitle = NSLocalizedString("vpn.feedback-form.error.title", value: "Error", comment: "Title for the alert when the VPN feedback form can't be submitted")
static let vpnFeedbackFormErrorMessage = NSLocalizedString("vpn.feedback-form.error.message", value: "Failed to share your feedback. Please try again.", comment: "Message for the alert when the VPN feedback form can't be submitted")
static let vpnFeedbackFormErrorAction = NSLocalizedString("vpn.feedback-form.error.action", value: "OK", comment: "Action title for the alert when the VPN feedback form can't be submitted")

// MARK: Notifications

Expand Down
11 changes: 1 addition & 10 deletions DuckDuckGo/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -2005,7 +2005,7 @@ But if you *do* want a peek under the hood, you can find more information about
"subscription.manage.devices" = "Manage Devices";

/* Description for Email Management options */
"subscription.manage.email.description" = "You can use this email to activate your subscription on your other devices.";
"subscription.manage.email.description" = "You can use this email to activate your subscription from browser settings in the DuckDuckGo app on your other devices.";

/* Manage Plan header */
"subscription.manage.plan" = "Manage Plan";
Expand Down Expand Up @@ -2232,15 +2232,6 @@ But if you *do* want a peek under the hood, you can find more information about
/* Title for the 'unable to install' category of the VPN feedback form */
"vpn.feedback-form.category.unable-to-install" = "Unable to install VPN";

/* Action title for the alert when the VPN feedback form can't be submitted */
"vpn.feedback-form.error.action" = "OK";

/* Message for the alert when the VPN feedback form can't be submitted */
"vpn.feedback-form.error.message" = "Failed to share your feedback. Please try again.";

/* Title for the alert when the VPN feedback form can't be submitted */
"vpn.feedback-form.error.title" = "Error";

/* Title for the feedback sent view description of the VPN feedback form */
"vpn.feedback-form.sending-confirmation.description" = "Your feedback will help us improve the\nDuckDuckGo VPN.";

Expand Down

0 comments on commit 0bf3e8f

Please sign in to comment.