diff --git a/submodules/TelegramCore/Sources/PeerPhotoUpdater.swift b/submodules/TelegramCore/Sources/PeerPhotoUpdater.swift index 9aac08971b..804707580f 100644 --- a/submodules/TelegramCore/Sources/PeerPhotoUpdater.swift +++ b/submodules/TelegramCore/Sources/PeerPhotoUpdater.swift @@ -294,10 +294,12 @@ public func updatePeerPhotoInternal(postbox: Postbox, network: Network, stateMan } } else { if let _ = peer as? TelegramUser { - return network.request(Api.functions.photos.updateProfilePhoto(id: Api.InputPhoto.inputPhotoEmpty)) - |> `catch` { _ -> Signal in - return .fail(.generic) + let signal: Signal = network.request(Api.functions.photos.updateProfilePhoto(id: Api.InputPhoto.inputPhotoEmpty)) + |> mapError { _ -> UploadPeerPhotoError in + return .generic } + + return signal |> mapToSignal { _ -> Signal in return .single(.complete([])) } @@ -341,7 +343,7 @@ public func updatePeerPhotoExisting(network: Network, reference: TelegramMediaIm switch reference { case let .cloud(imageId, accessHash, fileReference): return network.request(Api.functions.photos.updateProfilePhoto(id: .inputPhoto(id: imageId, accessHash: accessHash, fileReference: Buffer(data: fileReference)))) - |> `catch` { _ -> Signal in + |> `catch` { _ -> Signal in return .complete() } |> mapToSignal { _ -> Signal in