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 {
|
HStack {
|
||||||
Text("iCloud Status")
|
Text("iCloud Status")
|
||||||
Spacer()
|
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 {
|
switch cloudKitStatus {
|
||||||
case nil:
|
case nil:
|
||||||
EmptyView()
|
EmptyView()
|
||||||
|
@ -100,17 +117,6 @@ struct AdvancedPrefsView : View {
|
||||||
Text(String(describing: cloudKitStatus!))
|
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 {
|
var errorReportingSection: some View {
|
||||||
Section {
|
Section {
|
||||||
|
|
Loading…
Reference in New Issue