Don't show thread indicator in threads

This commit is contained in:
Justin Mazzocchi 2021-04-04 12:26:02 -07:00
parent 4a516cb4ea
commit 837218de5a
No known key found for this signature in database
GPG Key ID: E223E6937AAFB01C
4 changed files with 9 additions and 8 deletions

View File

@ -40,7 +40,8 @@ extension TimelineItemsInfo {
CollectionItem.status( CollectionItem.status(
.init(info: $0), .init(info: $0),
.init(showContentToggled: $0.showContentToggled, .init(showContentToggled: $0.showContentToggled,
showAttachmentsToggled: $0.showAttachmentsToggled), showAttachmentsToggled: $0.showAttachmentsToggled,
isReplyOutOfContext: ($0.reblogRecord ?? $0.record).inReplyToId != nil),
$0.reblogRelationship ?? $0.relationship) $0.reblogRelationship ?? $0.relationship)
} }
@ -67,7 +68,8 @@ extension TimelineItemsInfo {
.init(info: $0), .init(info: $0),
.init(showContentToggled: $0.showContentToggled, .init(showContentToggled: $0.showContentToggled,
showAttachmentsToggled: $0.showAttachmentsToggled, showAttachmentsToggled: $0.showAttachmentsToggled,
isPinned: true), isPinned: true,
isReplyOutOfContext: ($0.reblogRecord ?? $0.record).inReplyToId != nil),
$0.reblogRelationship ?? $0.relationship) $0.reblogRelationship ?? $0.relationship)
}), }),
.init(items: timelineItems)] .init(items: timelineItems)]

View File

@ -21,6 +21,7 @@ public extension CollectionItem {
public let isContextParent: Bool public let isContextParent: Bool
public let isPinned: Bool public let isPinned: Bool
public let isReplyInContext: Bool public let isReplyInContext: Bool
public let isReplyOutOfContext: Bool
public let hasReplyFollowing: Bool public let hasReplyFollowing: Bool
init(showContentToggled: Bool, init(showContentToggled: Bool,
@ -28,12 +29,14 @@ public extension CollectionItem {
isContextParent: Bool = false, isContextParent: Bool = false,
isPinned: Bool = false, isPinned: Bool = false,
isReplyInContext: Bool = false, isReplyInContext: Bool = false,
isReplyOutOfContext: Bool = false,
hasReplyFollowing: Bool = false) { hasReplyFollowing: Bool = false) {
self.showContentToggled = showContentToggled self.showContentToggled = showContentToggled
self.showAttachmentsToggled = showAttachmentsToggled self.showAttachmentsToggled = showAttachmentsToggled
self.isContextParent = isContextParent self.isContextParent = isContextParent
self.isPinned = isPinned self.isPinned = isPinned
self.isReplyInContext = isReplyInContext self.isReplyInContext = isReplyInContext
self.isReplyOutOfContext = isReplyOutOfContext
self.hasReplyFollowing = hasReplyFollowing self.hasReplyFollowing = hasReplyFollowing
} }
} }

View File

@ -77,10 +77,6 @@ public extension StatusViewModel {
sensitive || identityContext.identity.preferences.readingExpandMedia == .hideAll sensitive || identityContext.identity.preferences.readingExpandMedia == .hideAll
} }
var isReplyOutOfContext: Bool {
!configuration.isContextParent && statusService.status.displayStatus.inReplyToId != nil
}
var id: Status.Id { statusService.status.displayStatus.id } var id: Status.Id { statusService.status.displayStatus.id }
var accountName: String { "@".appending(statusService.status.displayStatus.account.acct) } var accountName: String { "@".appending(statusService.status.displayStatus.account.acct) }

View File

@ -110,7 +110,7 @@ extension StatusView {
configuration: configuration) configuration: configuration)
+ .compactSpacing + .compactSpacing
if !configuration.isContextParent && status.inReplyToId != nil { if configuration.isReplyOutOfContext {
height += UIFont.preferredFont(forTextStyle: .callout).lineHeight + .compactSpacing height += UIFont.preferredFont(forTextStyle: .callout).lineHeight + .compactSpacing
} }
@ -573,7 +573,7 @@ private extension StatusView {
bodyView.viewModel = viewModel bodyView.viewModel = viewModel
showThreadIndicator.isHidden = !viewModel.isReplyOutOfContext showThreadIndicator.isHidden = !viewModel.configuration.isReplyOutOfContext
contextParentTimeLabel.text = viewModel.contextParentTime contextParentTimeLabel.text = viewModel.contextParentTime
contextParentTimeLabel.accessibilityLabel = viewModel.accessibilityContextParentTime contextParentTimeLabel.accessibilityLabel = viewModel.accessibilityContextParentTime