fix: media sensitive button logic issue
This commit is contained in:
parent
4c1870f921
commit
2a986ec1ce
|
@ -321,9 +321,6 @@ extension StatusView.ViewModel {
|
||||||
|
|
||||||
statusView.setSpoilerOverlayViewHidden(isHidden: isContentReveal)
|
statusView.setSpoilerOverlayViewHidden(isHidden: isContentReveal)
|
||||||
|
|
||||||
let image = isContentReveal ? UIImage(systemName: "eye.slash.fill") : UIImage(systemName: "eye.fill")
|
|
||||||
statusView.contentSensitiveeToggleButton.setImage(image, for: .normal)
|
|
||||||
|
|
||||||
self.logger.log(level: .debug, "\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public): isContentReveal: \(isContentReveal)")
|
self.logger.log(level: .debug, "\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public): isContentReveal: \(isContentReveal)")
|
||||||
}
|
}
|
||||||
.store(in: &disposeBag)
|
.store(in: &disposeBag)
|
||||||
|
@ -335,29 +332,22 @@ extension StatusView.ViewModel {
|
||||||
}
|
}
|
||||||
.store(in: &disposeBag)
|
.store(in: &disposeBag)
|
||||||
|
|
||||||
// // visibility
|
// There are 2 conditions:
|
||||||
// Publishers.CombineLatest(
|
// 1. The content may non-sensitive with sensitive media
|
||||||
// $visibility,
|
// 2. The content and media both senstivie
|
||||||
// $isMyself
|
Publishers.CombineLatest(
|
||||||
// )
|
$isContentSensitiveToggled,
|
||||||
// .sink { visibility, isMyself in
|
$isMediaSensitiveToggled
|
||||||
// switch visibility {
|
)
|
||||||
// case .public:
|
.map { $0 || $1 }
|
||||||
// break
|
.sink { isSensitiveToggled in
|
||||||
// case .unlisted:
|
// The button indicator go-to state for button action direction
|
||||||
// statusView.statusVisibilityView.label.text = "Everyone can see this post but not display in the public timeline."
|
// eye: when media is hidden
|
||||||
// statusView.setVisibilityDisplay()
|
// eye-slash: when media display
|
||||||
// case .private:
|
let image = isSensitiveToggled ? UIImage(systemName: "eye.slash.fill") : UIImage(systemName: "eye.fill")
|
||||||
// statusView.statusVisibilityView.label.text = isMyself ? "Only my followers can see this post." : "Only their followers can see this post."
|
statusView.contentSensitiveeToggleButton.setImage(image, for: .normal)
|
||||||
// statusView.setVisibilityDisplay()
|
}
|
||||||
// case .direct:
|
.store(in: &disposeBag)
|
||||||
// statusView.statusVisibilityView.label.text = "Only mentioned user can see this post."
|
|
||||||
// statusView.setVisibilityDisplay()
|
|
||||||
// case ._other:
|
|
||||||
// break
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// .store(in: &disposeBag)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private func bindMedia(statusView: StatusView) {
|
private func bindMedia(statusView: StatusView) {
|
||||||
|
|
Loading…
Reference in New Issue