Various improvements

This commit is contained in:
Ilya Laktyushin
2025-03-18 20:12:41 +04:00
parent 730f03dcd8
commit d6eecb7844
18 changed files with 191 additions and 110 deletions

View File

@@ -11,6 +11,7 @@ public final class BotCheckoutController: ViewController {
public final class InputData {
public enum FetchError {
case generic
case disallowedStarGifts
}
public let form: BotPaymentForm
@@ -53,8 +54,13 @@ public final class BotCheckoutController: ViewController {
}
return context.engine.payments.fetchBotPaymentForm(source: source, themeParams: themeParams)
|> mapError { _ -> FetchError in
return .generic
|> mapError { error -> FetchError in
switch error {
case .disallowedStarGift:
return .disallowedStarGifts
default:
return .generic
}
}
|> mapToSignal { paymentForm -> Signal<InputData, FetchError> in
let botPeer: Signal<EnginePeer?, FetchError>