Fix various small warnings

This commit is contained in:
Stefan Ceriu
2024-01-04 12:39:15 +02:00
committed by Stefan Ceriu
parent 2a33ee1f63
commit b5be6639d1
3 changed files with 5 additions and 6 deletions
@@ -615,8 +615,6 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationCoordinatorDelegate,
switch callback { switch callback {
case .didReceiveAuthError(let isSoftLogout): case .didReceiveAuthError(let isSoftLogout):
stateMachine.processEvent(.signOut(isSoft: isSoftLogout, disableAppLock: false)) stateMachine.processEvent(.signOut(isSoft: isSoftLogout, disableAppLock: false))
default:
break
} }
} }
} }
@@ -157,12 +157,13 @@ struct FormattedBodyText: View {
} }
private var blockquoteAttributes: AttributeContainer { private var blockquoteAttributes: AttributeContainer {
var container = AttributeContainer() // The paragraph style removes the block style paragraph that the parser adds by default
// Set directly in the constructor to avoid `Conformance to 'Sendable'` warnings
var container = AttributeContainer([.paragraphStyle: NSParagraphStyle.default])
// Sadly setting SwiftUI fonts do not work so we would need UIFont equivalents for compound, this one is bodyMD // Sadly setting SwiftUI fonts do not work so we would need UIFont equivalents for compound, this one is bodyMD
container.font = UIFont.preferredFont(forTextStyle: .subheadline) container.font = UIFont.preferredFont(forTextStyle: .subheadline)
container.foregroundColor = UIColor.compound.textSecondary container.foregroundColor = UIColor.compound.textSecondary
// To remove the block style paragraph that the parser adds by default
container.paragraphStyle = .default
return container return container
} }
} }
@@ -54,7 +54,7 @@ struct RoomTimelineItemFactory: RoomTimelineItemFactoryProtocol {
return buildUnsupportedTimelineItem(eventItemProxy, eventType, error, isOutgoing) return buildUnsupportedTimelineItem(eventItemProxy, eventType, error, isOutgoing)
case .message: case .message:
return buildMessageTimelineItem(eventItemProxy, isOutgoing) return buildMessageTimelineItem(eventItemProxy, isOutgoing)
case .state(let stateKey, let content): case .state(_, let content):
return buildStateTimelineItem(for: eventItemProxy, state: content, isOutgoing: isOutgoing) return buildStateTimelineItem(for: eventItemProxy, state: content, isOutgoing: isOutgoing)
case .roomMembership(userId: let userID, change: let change): case .roomMembership(userId: let userID, change: let change):
return buildStateMembershipChangeTimelineItem(for: eventItemProxy, member: userID, membershipChange: change, isOutgoing: isOutgoing) return buildStateMembershipChangeTimelineItem(for: eventItemProxy, member: userID, membershipChange: change, isOutgoing: isOutgoing)