- blocking fix [skip ci

]
This commit is contained in:
overtake
2020-09-22 12:28:12 +03:00
parent 01fa52cbb6
commit 30065e976e

View File

@@ -219,15 +219,17 @@ public final class BlockedPeersContext {
}
|> mapToSignal { value in
return postbox.transaction { transaction -> Peer? in
transaction.updatePeerCachedData(peerIds: Set([peerId]), update: { _, current in
let previous: CachedUserData
if let current = current as? CachedUserData {
previous = current
} else {
previous = CachedUserData()
}
return previous.withUpdatedIsBlocked(false)
})
if peerId.namespace == Namespaces.Peer.CloudUser {
transaction.updatePeerCachedData(peerIds: Set([peerId]), update: { _, current in
let previous: CachedUserData
if let current = current as? CachedUserData {
previous = current
} else {
previous = CachedUserData()
}
return previous.withUpdatedIsBlocked(false)
})
}
return transaction.getPeer(peerId)
}
|> castError(BlockedPeersContextRemoveError.self)