Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent duplicate reporting on VPN feedback form #2511

Merged
merged 1 commit into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading