mirror of
https://github.com/mastodon/mastodon-ios
synced 2025-04-11 22:58:02 +02:00
Receive some actions on main-queue
This commit is contained in:
parent
6df7cf8a80
commit
af9cce34eb
@ -98,6 +98,7 @@ extension ProfileHeaderView.ViewModel {
|
||||
// follows you
|
||||
$relationshipActionOptionSet
|
||||
.map { $0.contains(.followingBy) && !$0.contains(.isMyself) }
|
||||
.receive(on: DispatchQueue.main)
|
||||
.sink { isFollowingBy in
|
||||
view.followsYouBlurEffectView.isHidden = !isFollowingBy
|
||||
}
|
||||
@ -182,16 +183,19 @@ extension ProfileHeaderView.ViewModel {
|
||||
}
|
||||
.store(in: &disposeBag)
|
||||
$relationshipActionOptionSet
|
||||
.receive(on: DispatchQueue.main)
|
||||
.sink { optionSet in
|
||||
let isBlocking = optionSet.contains(.blocking)
|
||||
let isBlockedBy = optionSet.contains(.blockingBy)
|
||||
let isSuspended = optionSet.contains(.suspended)
|
||||
let isNeedsHidden = isBlocking || isBlockedBy || isSuspended
|
||||
|
||||
view.bioMetaText.textView.isHidden = isNeedsHidden
|
||||
}
|
||||
.store(in: &disposeBag)
|
||||
// dashboard
|
||||
$isMyself
|
||||
.receive(on: DispatchQueue.main)
|
||||
.sink { isMyself in
|
||||
if isMyself {
|
||||
view.statusDashboardView.postDashboardMeterView.textLabel.text = L10n.Scene.Profile.Dashboard.myPosts
|
||||
@ -246,6 +250,7 @@ extension ProfileHeaderView.ViewModel {
|
||||
$isEditing,
|
||||
$isUpdating
|
||||
)
|
||||
.receive(on: DispatchQueue.main)
|
||||
.sink { relationshipActionOptionSet, isEditing, isUpdating in
|
||||
if relationshipActionOptionSet.contains(.edit) {
|
||||
// check .edit state and set .editing when isEditing
|
||||
|
@ -126,6 +126,7 @@ public final class RelationshipViewModel {
|
||||
$me,
|
||||
relationshipUpdatePublisher
|
||||
)
|
||||
.receive(on: DispatchQueue.main)
|
||||
.sink { [weak self] user, me, _ in
|
||||
guard let self = self else { return }
|
||||
self.update(user: user, me: me)
|
||||
|
Loading…
x
Reference in New Issue
Block a user