mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-06 03:33:41 +02:00
- blocking fix [skip ci
]
This commit is contained in:
parent
01fa52cbb6
commit
30065e976e
1 changed files with 11 additions and 9 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue