fix: real Xcode compile errors from Swift 6 strict concurrency
- SettingsView: ternary between .secondary (HierarchicalShapeStyle) and .red (Color) doesn't unify — both sides now explicit Color. - CollectionRowView: passing OutlineIconMapping.sfSymbolName as a bare function reference to flatMap loses its (inferred default) MainActor isolation; wrapping it in a closure keeps the call inside body's already-MainActor context. - NetworkMonitor: [weak self] was captured on NWPathMonitor's non-isolated pathUpdateHandler closure, which must cross into the inner @MainActor Task — moved the weak capture onto the Task closure itself instead, which is where it's actually used.
This commit is contained in:
@@ -126,7 +126,7 @@ struct SettingsView: View {
|
||||
if let lastFullSyncSummary {
|
||||
Text(fullSyncSummaryText(lastFullSyncSummary))
|
||||
.font(.caption)
|
||||
.foregroundStyle(lastFullSyncSummary.errors.isEmpty ? .secondary : .red)
|
||||
.foregroundStyle(lastFullSyncSummary.errors.isEmpty ? Color.secondary : Color.red)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ struct CollectionRowView: View {
|
||||
} icon: {
|
||||
if let emoji = collection.emojiIcon {
|
||||
Text(emoji)
|
||||
} else if let symbolName = collection.icon.flatMap(OutlineIconMapping.sfSymbolName) {
|
||||
} else if let symbolName = collection.icon.flatMap({ OutlineIconMapping.sfSymbolName(for: $0) }) {
|
||||
Image(systemName: symbolName)
|
||||
.foregroundStyle(tintColor)
|
||||
} else {
|
||||
|
||||
@@ -14,9 +14,9 @@ final class NetworkMonitor {
|
||||
private let queue = DispatchQueue(label: "com.outpost.network-monitor")
|
||||
|
||||
init() {
|
||||
monitor.pathUpdateHandler = { [weak self] path in
|
||||
monitor.pathUpdateHandler = { path in
|
||||
let online = path.status == .satisfied
|
||||
Task { @MainActor in
|
||||
Task { @MainActor [weak self] in
|
||||
self?.isOnline = online
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user