forked from zelo72/mastodon-ios
chore: remove spoiler toggle animation for table cell
This commit is contained in:
parent
d1441aee8c
commit
471384d5f3
Mastodon/Scene/Share/View/TableviewCell
MastodonSDK/Sources/MastodonUI/View/Content
|
@ -53,17 +53,16 @@ extension StatusTableViewCell {
|
|||
|
||||
self.delegate = delegate
|
||||
|
||||
|
||||
statusView.viewModel.$isContentReveal
|
||||
.removeDuplicates()
|
||||
.dropFirst()
|
||||
statusView.viewModel.isNeedsTableViewUpdate
|
||||
.receive(on: DispatchQueue.main)
|
||||
.sink { [weak tableView, weak self] isContentReveal in
|
||||
.sink { [weak tableView, weak self] in
|
||||
guard let tableView = tableView else { return }
|
||||
guard let self = self else { return }
|
||||
guard let _ = self else { return }
|
||||
|
||||
tableView.beginUpdates()
|
||||
tableView.endUpdates()
|
||||
UIView.performWithoutAnimation {
|
||||
tableView.beginUpdates()
|
||||
tableView.endUpdates()
|
||||
}
|
||||
}
|
||||
.store(in: &disposeBag)
|
||||
}
|
||||
|
|
|
@ -88,6 +88,8 @@ extension StatusView {
|
|||
@Published public var reblogCount: Int = 0
|
||||
@Published public var favoriteCount: Int = 0
|
||||
|
||||
public let isNeedsTableViewUpdate = PassthroughSubject<Void, Never>()
|
||||
|
||||
let timestampUpdatePublisher = Timer.publish(every: 1.0, on: .main, in: .common)
|
||||
.autoconnect()
|
||||
.share()
|
||||
|
@ -282,6 +284,8 @@ extension StatusView.ViewModel {
|
|||
}
|
||||
|
||||
statusView.setSpoilerOverlayViewHidden(isHidden: isContentReveal)
|
||||
|
||||
self.isNeedsTableViewUpdate.send()
|
||||
}
|
||||
.store(in: &disposeBag)
|
||||
// visibility
|
||||
|
|
Loading…
Reference in New Issue