forked from shadowfacts/Tusker
Tweak iCloud status appearance in advanced prefs
This commit is contained in:
parent
c32181818a
commit
ee7bf5138c
|
@ -83,6 +83,23 @@ struct AdvancedPrefsView : View {
|
|||
HStack {
|
||||
Text("iCloud Status")
|
||||
Spacer()
|
||||
cloudKitStatusLabel
|
||||
.foregroundStyle(.secondary)
|
||||
}
|
||||
}
|
||||
.appGroupedListRowBackground()
|
||||
.task {
|
||||
do {
|
||||
let status = try await CKContainer.default().accountStatus()
|
||||
self.cloudKitStatus = status
|
||||
} catch {
|
||||
Logging.general.error("Unable to get CloudKit status: \(String(describing: error))")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
private var cloudKitStatusLabel: some View {
|
||||
switch cloudKitStatus {
|
||||
case nil:
|
||||
EmptyView()
|
||||
|
@ -100,17 +117,6 @@ struct AdvancedPrefsView : View {
|
|||
Text(String(describing: cloudKitStatus!))
|
||||
}
|
||||
}
|
||||
}
|
||||
.appGroupedListRowBackground()
|
||||
.task {
|
||||
do {
|
||||
let status = try await CKContainer.default().accountStatus()
|
||||
self.cloudKitStatus = status
|
||||
} catch {
|
||||
Logging.general.error("Unable to get CloudKit status: \(String(describing: error))")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var errorReportingSection: some View {
|
||||
Section {
|
||||
|
|
Loading…
Reference in New Issue