diff --git a/submodules/TelegramCore/Sources/TelegramEngine/Payments/BotPaymentForm.swift b/submodules/TelegramCore/Sources/TelegramEngine/Payments/BotPaymentForm.swift index 1f1bc9463b..a07e409376 100644 --- a/submodules/TelegramCore/Sources/TelegramEngine/Payments/BotPaymentForm.swift +++ b/submodules/TelegramCore/Sources/TelegramEngine/Payments/BotPaymentForm.swift @@ -172,6 +172,7 @@ extension BotPaymentMethod { public enum BotPaymentFormRequestError { case generic + case alreadyActive } extension BotPaymentInvoice { @@ -385,8 +386,12 @@ func _internal_fetchBotPaymentInvoice(postbox: Postbox, network: Network, source let flags: Int32 = 0 return network.request(Api.functions.payments.getPaymentForm(flags: flags, invoice: invoice, themeParams: nil)) - |> `catch` { _ -> Signal in - return .fail(.generic) + |> `catch` { error -> Signal in + if error.errorDescription == "SUBSCRIPTION_ALREADY_ACTIVE" { + return .fail(.alreadyActive) + } else { + return .fail(.generic) + } } |> mapToSignal { result -> Signal in return postbox.transaction { transaction -> TelegramMediaInvoice in