mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
Various fixes
This commit is contained in:
@@ -1549,5 +1549,19 @@ func openResolvedUrlImpl(
|
||||
}
|
||||
navigationController?.pushViewController(controller)
|
||||
}
|
||||
case let .sendGift(peerId):
|
||||
Task { @MainActor [weak navigationController] in
|
||||
if let peerId {
|
||||
let giftOptions = await (context.engine.payments.premiumGiftCodeOptions(peerId: nil, onlyCached: true) |> filter { !$0.isEmpty }).get()
|
||||
|
||||
let premiumOptions = giftOptions.filter { $0.users == 1 }.map { CachedPremiumGiftOption(months: $0.months, currency: $0.currency, amount: $0.amount, botUrl: "", storeProductId: $0.storeProductId) }
|
||||
let controller = context.sharedContext.makeGiftOptionsController(context: context, peerId: peerId, premiumOptions: premiumOptions, hasBirthday: false, completion: nil)
|
||||
controller.navigationPresentation = .modal
|
||||
navigationController?.pushViewController(controller)
|
||||
} else {
|
||||
let controller = context.sharedContext.makePremiumGiftController(context: context, source: .settings(nil), completion: nil)
|
||||
navigationController?.pushViewController(controller)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user