|
|
@@ -25,13 +25,23 @@ extension Onboarding {
|
|
|
|
|
|
// MARK: - App Diagnostics
|
|
|
|
|
|
- var diagnosticsSharingOption: DiagnosticsSharingOption {
|
|
|
- get { (PropertyPersistentFlags.shared.diagnosticsSharingEnabled ?? true) ? .enabled : .disabled }
|
|
|
- set { PropertyPersistentFlags.shared.diagnosticsSharingEnabled = (newValue == .enabled) }
|
|
|
+ private var persistedDiagnosticsSharing: Bool? {
|
|
|
+ get { PropertyPersistentFlags.shared.diagnosticsSharingEnabled }
|
|
|
+ set { PropertyPersistentFlags.shared.diagnosticsSharingEnabled = newValue }
|
|
|
}
|
|
|
|
|
|
+ var diagnosticsSharingOption: DiagnosticsSharingOption = .enabled
|
|
|
var hasAcceptedPrivacyPolicy: Bool = false
|
|
|
|
|
|
+ func syncDiagnosticsOptionFromStorage() {
|
|
|
+ diagnosticsSharingOption = (persistedDiagnosticsSharing ?? true) ? .enabled : .disabled
|
|
|
+ }
|
|
|
+
|
|
|
+ func updateDiagnosticsOption(to option: DiagnosticsSharingOption) {
|
|
|
+ diagnosticsSharingOption = option
|
|
|
+ persistedDiagnosticsSharing = (option == .enabled)
|
|
|
+ }
|
|
|
+
|
|
|
// MARK: - Determine Initial Build State
|
|
|
|
|
|
/// Determines whether the app is in a fresh install state for Trio v0.3.0.
|