Show "✅ Post Sent!"-pill if post was sent successfully (IOS-234)
Maybe we could think about an error-message here, too?
This commit is contained in:
parent
527d250024
commit
6c0faede75
|
@ -332,6 +332,20 @@ extension HomeTimelineViewController {
|
|||
}
|
||||
})
|
||||
.store(in: &disposeBag)
|
||||
|
||||
context.publisherService.statusPublishResult.prepend(.failure(AppError.badRequest))
|
||||
.receive(on: DispatchQueue.main)
|
||||
.sink { [weak self] publishResult in
|
||||
guard let self else { return }
|
||||
switch publishResult {
|
||||
case .success:
|
||||
self.timelinePill.update(with: .postSent)
|
||||
self.showTimelinePill()
|
||||
case .failure:
|
||||
self.hideTimelinePill()
|
||||
}
|
||||
}
|
||||
.store(in: &disposeBag)
|
||||
}
|
||||
|
||||
override func viewWillAppear(_ animated: Bool) {
|
||||
|
|
|
@ -33,7 +33,7 @@ final class HomeTimelineViewModel: NSObject {
|
|||
@Published var scrollPositionRecord: ScrollPositionRecord? = nil
|
||||
@Published var displaySettingBarButtonItem = true
|
||||
@Published var hasPendingStatusEditReload = false
|
||||
var hasNewPosts = CurrentValueSubject<Bool, Never>(false)
|
||||
let hasNewPosts = CurrentValueSubject<Bool, Never>(false)
|
||||
var timelineContext: MastodonFeed.Kind.TimelineContext = .home
|
||||
|
||||
weak var tableView: UITableView?
|
||||
|
|
Loading…
Reference in New Issue