Display pinned state whe modifying

This commit is contained in:
Justin Mazzocchi 2021-02-03 13:51:45 -08:00
parent 533a1d1830
commit 4142e66862
No known key found for this signature in database
GPG key ID: E223E6937AAFB01C
3 changed files with 5 additions and 1 deletions

View file

@ -355,6 +355,8 @@ private extension TableViewController {
switch event { switch event {
case .ignorableOutput: case .ignorableOutput:
break break
case .refresh:
refreshIfAble()
case let .share(url): case let .share(url):
share(url: url) share(url: url)
case let .navigation(navigation): case let .navigation(navigation):

View file

@ -6,6 +6,7 @@ import ServiceLayer
public enum CollectionItemEvent { public enum CollectionItemEvent {
case ignorableOutput case ignorableOutput
case refresh
case navigation(Navigation) case navigation(Navigation)
case attachment(AttachmentViewModel, StatusViewModel) case attachment(AttachmentViewModel, StatusViewModel)
case compose(inReplyTo: StatusViewModel?, redraft: Status?) case compose(inReplyTo: StatusViewModel?, redraft: Status?)

View file

@ -255,7 +255,8 @@ public extension StatusViewModel {
func togglePinned() { func togglePinned() {
eventsSubject.send( eventsSubject.send(
statusService.togglePinned() statusService.togglePinned()
.map { _ in .ignorableOutput } .collect()
.map { _ in .refresh }
.eraseToAnyPublisher()) .eraseToAnyPublisher())
} }