mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
- blocking fix [skip ci
]
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user