Ensure reply indicators only show up in threads

This commit is contained in:
Justin Mazzocchi 2020-09-26 17:47:30 -07:00
parent 236261ccdb
commit 098d439722
No known key found for this signature in database
GPG key ID: E223E6937AAFB01C

View file

@ -160,6 +160,7 @@ private extension StatusListViewModel {
func isReplyInContext(status: Status) -> Bool {
guard
let contextParentID = contextParentID,
let index = flatStatusIDs.firstIndex(where: { $0 == status.id }),
index > 0
else { return false }
@ -171,6 +172,7 @@ private extension StatusListViewModel {
func hasReplyFollowing(status: Status) -> Bool {
guard
let contextParentID = contextParentID,
let index = flatStatusIDs.firstIndex(where: { $0 == status.id }),
flatStatusIDs.count > index + 1,
let nextStatus = statuses[flatStatusIDs[index + 1]]