Fix pinned stats display issues

This commit is contained in:
Justin Mazzocchi 2020-09-28 13:52:46 -07:00
parent 2f42a73b9a
commit 8b6a521db1
No known key found for this signature in database
GPG Key ID: E223E6937AAFB01C
1 changed files with 6 additions and 2 deletions

View File

@ -33,8 +33,12 @@ public class ProfileViewModel: StatusListViewModel {
// so a diffable data source can potentially render it in both sections
super.collectionItems
.map {
$0.enumerated().map {
$0 == 0 ? $1.map { .init(id: $0.id, kind: $0.kind, info: [.pinned: true]) } : $1
$0.enumerated().map { [weak self] in
if let self = self, self.collection == .statuses, $0 == 0 {
return $1.map { .init(id: $0.id, kind: $0.kind, info: [.pinned: true]) }
} else {
return $1
}
}
}
.eraseToAnyPublisher()