mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Fixes #4180 - Prevent room header autolayout crashes on iOS 26.
This commit is contained in:
@@ -17,6 +17,18 @@ struct RoomHeaderView: View {
|
|||||||
let mediaProvider: MediaProviderProtocol?
|
let mediaProvider: MediaProviderProtocol?
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
|
if #available(iOS 26, *) {
|
||||||
|
// https://github.com/element-hq/element-x-ios/issues/4180
|
||||||
|
// Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'NSLayoutConstraint constant is not finite!
|
||||||
|
content
|
||||||
|
} else {
|
||||||
|
content
|
||||||
|
// Take up as much space as possible, with a leading alignment for use in the principal toolbar position
|
||||||
|
.frame(idealWidth: .greatestFiniteMagnitude, maxWidth: .infinity, alignment: .leading)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private var content: some View {
|
||||||
HStack(spacing: 8) {
|
HStack(spacing: 8) {
|
||||||
avatarImage
|
avatarImage
|
||||||
.accessibilityHidden(true)
|
.accessibilityHidden(true)
|
||||||
@@ -32,8 +44,6 @@ struct RoomHeaderView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Take up as much space as possible, with a leading alignment for use in the principal toolbar position.
|
|
||||||
.frame(idealWidth: .greatestFiniteMagnitude, maxWidth: .infinity, alignment: .leading)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private var avatarImage: some View {
|
private var avatarImage: some View {
|
||||||
|
|||||||
Reference in New Issue
Block a user