Tweak iCloud status appearance in advanced prefs

This commit is contained in:
Shadowfacts 2024-04-15 00:12:34 -04:00
parent c32181818a
commit ee7bf5138c
1 changed files with 22 additions and 16 deletions

View File

@ -83,22 +83,8 @@ struct AdvancedPrefsView : View {
HStack { HStack {
Text("iCloud Status") Text("iCloud Status")
Spacer() Spacer()
switch cloudKitStatus { cloudKitStatusLabel
case nil: .foregroundStyle(.secondary)
EmptyView()
case .available:
Text("Available")
case .couldNotDetermine:
Text("Could not determine")
case .noAccount:
Text("No account")
case .restricted:
Text("Restricted")
case .temporarilyUnavailable:
Text("Temporarily Unavailable")
@unknown default:
Text(String(describing: cloudKitStatus!))
}
} }
} }
.appGroupedListRowBackground() .appGroupedListRowBackground()
@ -112,6 +98,26 @@ struct AdvancedPrefsView : View {
} }
} }
@ViewBuilder
private var cloudKitStatusLabel: some View {
switch cloudKitStatus {
case nil:
EmptyView()
case .available:
Text("Available")
case .couldNotDetermine:
Text("Could not determine")
case .noAccount:
Text("No account")
case .restricted:
Text("Restricted")
case .temporarilyUnavailable:
Text("Temporarily Unavailable")
@unknown default:
Text(String(describing: cloudKitStatus!))
}
}
var errorReportingSection: some View { var errorReportingSection: some View {
Section { Section {
Toggle("Report Errors Automatically", isOn: $preferences.reportErrorsAutomatically) Toggle("Report Errors Automatically", isOn: $preferences.reportErrorsAutomatically)