StatusRow: Flatify the hierarchy to work around iOS 16.4 issues

This commit is contained in:
Thomas Ricouard 2023-03-01 17:34:03 +01:00
parent 87ef2f2a39
commit 43a4551d9b

View file

@ -26,19 +26,16 @@ public struct StatusRowView: View {
} }
public var body: some View { public var body: some View {
VStack(alignment: .leading) {
let status: AnyStatus = viewModel.status.reblog ?? viewModel.status
if viewModel.isFiltered, let filter = viewModel.filter { if viewModel.isFiltered, let filter = viewModel.filter {
switch filter.filter.filterAction { switch filter.filter.filterAction {
case .warn: case .warn:
makeFilterView(filter: filter.filter) makeFilterView(filter: filter.filter)
.listRowBackground(viewModel.highlightRowColor)
case .hide: case .hide:
EmptyView() EmptyView()
.listRowSeparator(.hidden)
.listRowInsets(.init())
} }
} else { } else {
let status: AnyStatus = viewModel.status.reblog ?? viewModel.status
VStack(alignment: .leading) {
if !isCompact, theme.avatarPosition == .leading { if !isCompact, theme.avatarPosition == .leading {
StatusRowReblogView(viewModel: viewModel) StatusRowReblogView(viewModel: viewModel)
StatusRowReplyView(viewModel: viewModel) StatusRowReplyView(viewModel: viewModel)
@ -85,6 +82,7 @@ public struct StatusRowView: View {
} }
} }
} }
}
.onAppear { .onAppear {
viewModel.markSeen() viewModel.markSeen()
if reasons.isEmpty { if reasons.isEmpty {
@ -153,7 +151,6 @@ public struct StatusRowView: View {
client: client) client: client)
) )
} }
}
@ViewBuilder @ViewBuilder
private var accesibilityActions: some View { private var accesibilityActions: some View {