summaryrefslogtreecommitdiffhomepage
path: root/ios/MullvadVPN/View controllers/ProblemReport/ProblemReportViewModel.swift
blob: c1a14c9cb28ae89a09d8273f07c61f5e748d0db4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
//
//  ProblemReportViewModel.swift
//  MullvadVPN
//
//  Created by Marco Nikic on 2024-02-09.
//  Copyright © 2025 Mullvad VPN AB. All rights reserved.
//

import Foundation

struct ProblemReportViewModel {
    let email: String
    let message: String

    static let navigationTitle = NSLocalizedString("Report a problem", comment: "")

    static let subheadLabelText = NSLocalizedString(
        "To help you more effectively, your app’s log file will be attached to this message. "
            + "Your data will remain secure and private, as it is anonymised before being "
            + "sent over an encrypted channel.",
        comment: ""
    )

    static let emailPlaceholderText = NSLocalizedString("Your email (optional)", comment: "")

    static let messageTextViewPlaceholder = NSLocalizedString(
        "To assist you better, please write in English or Swedish and include which country you are connecting from.",
        comment: ""
    )

    static let viewLogsButtonTitle = NSLocalizedString("View app logs", comment: "")

    static let sendLogsButtonTitle = NSLocalizedString("Send", comment: "")

    static let emptyEmailAlertWarning = NSLocalizedString(
        "You are about to send the problem report without a way for us to get back to you. "
            + "If you want an answer to your report you will have to enter an email address.",
        comment: ""
    )

    static let confirmEmptyEmailTitle = NSLocalizedString("Send anyway", comment: "")

    static let cancelEmptyEmailTitle = NSLocalizedString("Cancel", comment: "")

    init() {
        email = ""
        message = ""
    }

    init(email: String, message: String) {
        self.email = email.trimmingCharacters(in: .whitespacesAndNewlines)
        self.message = message.trimmingCharacters(in: .whitespacesAndNewlines)
    }

    var isValid: Bool {
        !message.isEmpty
    }
}