Various fixes

This commit is contained in:
Ilya Laktyushin
2025-08-18 17:33:54 +04:00
parent ea63abbc8a
commit bdaf5f5a02
7 changed files with 52 additions and 5 deletions

View File

@@ -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)
}
}
}
}