fix(settings): surface the actual full-sync error, not just a count
"Synced with 1 error" gave no way to tell what failed. Now lists each FullSyncSummary.errors entry underneath the summary line.
This commit is contained in:
@@ -173,19 +173,28 @@ struct SettingsView: View {
|
||||
.frame(maxWidth: 480, alignment: .leading)
|
||||
|
||||
if isFullLocalSyncEnabled {
|
||||
HStack(spacing: 8) {
|
||||
if isSyncing {
|
||||
ProgressView().controlSize(.small)
|
||||
Text("Syncing…")
|
||||
.font(.caption)
|
||||
.foregroundStyle(.secondary)
|
||||
} else {
|
||||
Button("Sync Now") { Task { await runFullSync() } }
|
||||
.controlSize(.small)
|
||||
if let lastFullSyncSummary {
|
||||
Text(fullSyncSummaryText(lastFullSyncSummary))
|
||||
VStack(alignment: .leading, spacing: 6) {
|
||||
HStack(spacing: 8) {
|
||||
if isSyncing {
|
||||
ProgressView().controlSize(.small)
|
||||
Text("Syncing…")
|
||||
.font(.caption)
|
||||
.foregroundStyle(.secondary)
|
||||
} else {
|
||||
Button("Sync Now") { Task { await runFullSync() } }
|
||||
.controlSize(.small)
|
||||
if let lastFullSyncSummary {
|
||||
Text(fullSyncSummaryText(lastFullSyncSummary))
|
||||
.font(.caption)
|
||||
.foregroundStyle(lastFullSyncSummary.errors.isEmpty ? .secondary : .red)
|
||||
}
|
||||
}
|
||||
}
|
||||
if let lastFullSyncSummary, !isSyncing {
|
||||
ForEach(Array(lastFullSyncSummary.errors.enumerated()), id: \.offset) { _, message in
|
||||
Text(message)
|
||||
.font(.caption2)
|
||||
.foregroundStyle(.red)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user