field_ios

In-the-field app for Radroots on iOS
git clone https://radroots.dev/git/field_ios.git
Log | Files | Refs | README | LICENSE

TeraSupportSettingsSection.swift (1407B)


      1 import Foundation
      2 import SwiftUI
      3 
      4 /// Read the approved packaged contact. No message or diagnostics are sent
      5 /// until the person chooses an external action and submits it themselves.
      6 enum TeraSupportContact {
      7   static func mailURL(email: String?) -> URL? {
      8     guard email == "support@radroots.org" else { return nil }
      9     return URL(string: "mailto:support@radroots.org")
     10   }
     11 
     12   static var packagedMailURL: URL? {
     13     mailURL(email: Bundle.main.object(forInfoDictionaryKey: "TeraSupportEmail") as? String)
     14   }
     15 }
     16 
     17 struct TeraSupportSettingsSection: View {
     18   var body: some View {
     19     Section("Support and privacy") {
     20       if let contact = TeraSupportContact.packagedMailURL {
     21         Link("Contact Radroots Support", destination: contact)
     22           .accessibilityIdentifier("tera.settings.support.contact")
     23       }
     24       Text("Review a diagnostics export before you share it.")
     25         .fixedSize(horizontal: false, vertical: true)
     26         .accessibilityIdentifier("tera.settings.support.review")
     27       Text("Removing a local signing key does not erase remote copies.")
     28         .fixedSize(horizontal: false, vertical: true)
     29         .accessibilityIdentifier("tera.settings.support.local_removal")
     30       Text("Relays and other people may keep copies of public posts.")
     31         .fixedSize(horizontal: false, vertical: true)
     32         .accessibilityIdentifier("tera.settings.support.remote_copies")
     33     }
     34   }
     35 }