Fix threading UI

This commit is contained in:
Thomas Ricouard 2023-02-19 20:56:56 +01:00
parent 052586022d
commit aa63dd5ab7

View file

@ -99,10 +99,17 @@ public struct StatusDetailView: View {
var isReplyToPrevious: Bool = false var isReplyToPrevious: Bool = false
if let index = statuses.firstIndex(where: { $0.id == status.id }), if let index = statuses.firstIndex(where: { $0.id == status.id }),
index > 0, index > 0,
statuses[index - 1].id == status.inReplyToId && status.inReplyToId != statuses.first?.id statuses[index - 1].id == status.inReplyToId
{ {
if index == 1, statuses.count > 2 {
let nextStatus = statuses[2]
isReplyToPrevious = nextStatus.inReplyToId == status.id
} else if statuses.count == 2 {
isReplyToPrevious = false
} else {
isReplyToPrevious = true isReplyToPrevious = true
} }
}
let viewModel: StatusRowViewModel = .init(status: status, let viewModel: StatusRowViewModel = .init(status: status,
client: client, client: client,
routerPath: routerPath) routerPath: routerPath)