Add option to disable automatic crash reporting
This commit is contained in:
parent
91450ced7c
commit
c5921bc4cb
|
@ -70,6 +70,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||||
options.enableNetworkTracking = false
|
options.enableNetworkTracking = false
|
||||||
options.enableAppHangTracking = false
|
options.enableAppHangTracking = false
|
||||||
options.enableCoreDataTracking = false
|
options.enableCoreDataTracking = false
|
||||||
|
|
||||||
|
options.beforeSend = { event in
|
||||||
|
Preferences.shared.reportErrorsAutomatically ? event : nil
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -149,6 +149,7 @@ class Preferences: Codable, ObservableObject {
|
||||||
|
|
||||||
// MARK: Advanced
|
// MARK: Advanced
|
||||||
@Published var statusContentType: StatusContentType = .plain
|
@Published var statusContentType: StatusContentType = .plain
|
||||||
|
@Published var reportErrorsAutomatically = true
|
||||||
|
|
||||||
// MARK:
|
// MARK:
|
||||||
@Published var hasShownLocalTimelineDescription = false
|
@Published var hasShownLocalTimelineDescription = false
|
||||||
|
|
|
@ -15,6 +15,7 @@ struct AdvancedPrefsView : View {
|
||||||
var body: some View {
|
var body: some View {
|
||||||
List {
|
List {
|
||||||
formattingSection
|
formattingSection
|
||||||
|
errorReportingSection
|
||||||
cachingSection
|
cachingSection
|
||||||
}
|
}
|
||||||
.listStyle(InsetGroupedListStyle())
|
.listStyle(InsetGroupedListStyle())
|
||||||
|
@ -36,6 +37,22 @@ struct AdvancedPrefsView : View {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var errorReportingSection: some View {
|
||||||
|
Section {
|
||||||
|
Toggle("Report Errors Automatically", isOn: $preferences.reportErrorsAutomatically)
|
||||||
|
} footer: {
|
||||||
|
var privacyPolicy: AttributedString = "Privacy Policy"
|
||||||
|
let _ = privacyPolicy.link = URL(string: "https://vaccor.space/tusker#privacy")!
|
||||||
|
if preferences.reportErrorsAutomatically {
|
||||||
|
Text(AttributedString("App crashes and errors will be automatically reported to the developer. You may be prompted to add additional information.\n") + privacyPolicy)
|
||||||
|
.lineLimit(nil)
|
||||||
|
} else {
|
||||||
|
Text(AttributedString("Errors will not be reported automatically. When a crash occurs, you may be asked to report it manually.\n") + privacyPolicy)
|
||||||
|
.lineLimit(nil)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var cachingSection: some View {
|
var cachingSection: some View {
|
||||||
Section(header: Text("Caching"), footer: Text("Clearing caches will restart the app.")) {
|
Section(header: Text("Caching"), footer: Text("Clearing caches will restart the app.")) {
|
||||||
Button(action: clearCache) {
|
Button(action: clearCache) {
|
||||||
|
|
Loading…
Reference in New Issue