mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Fix build
This commit is contained in:
parent
0722a22bec
commit
ca9898eb83
@ -1479,7 +1479,15 @@ public func createGiveawayController(context: AccountContext, updatedPresentatio
|
||||
return updatedState
|
||||
}
|
||||
|
||||
let _ = (context.engine.payments.launchPrepaidGiveaway(peerId: peerId, id: prepaidGiveaway.id, additionalPeerIds: state.channels.filter { $0 != peerId }, countries: state.countries, onlyNewSubscribers: state.onlyNewEligible, showWinners: state.showWinners, prizeDescription: state.prizeDescription.isEmpty ? nil : state.prizeDescription, randomId: Int64.random(in: .min ..< .max), untilDate: state.time)
|
||||
let purpose: LaunchGiveawayPurpose
|
||||
switch prepaidGiveaway.prize {
|
||||
case .premium:
|
||||
purpose = .premium
|
||||
case let .stars(stars, _):
|
||||
purpose = .stars(stars: stars, users: state.winners)
|
||||
}
|
||||
|
||||
let _ = (context.engine.payments.launchPrepaidGiveaway(peerId: peerId, id: prepaidGiveaway.id, purpose: purpose, additionalPeerIds: state.channels.filter { $0 != peerId }, countries: state.countries, onlyNewSubscribers: state.onlyNewEligible, showWinners: state.showWinners, prizeDescription: state.prizeDescription.isEmpty ? nil : state.prizeDescription, randomId: Int64.random(in: .min ..< .max), untilDate: state.time)
|
||||
|> deliverOnMainQueue).startStandalone(completed: {
|
||||
if let controller, let navigationController = controller.navigationController as? NavigationController {
|
||||
var controllers = navigationController.viewControllers
|
||||
|
@ -269,7 +269,6 @@ func _internal_launchPrepaidGiveaway(account: Account, peerId: EnginePeer.Id, pu
|
||||
inputPurpose = .inputStorePaymentPremiumGiveaway(flags: flags, boostPeer: inputPeer, additionalPeers: additionalPeers, countriesIso2: countries, prizeDescription: prizeDescription, randomId: randomId, untilDate: untilDate, currency: "", amount: 0)
|
||||
}
|
||||
|
||||
|
||||
return account.network.request(Api.functions.payments.launchPrepaidGiveaway(peer: inputPeer, giveawayId: id, purpose: inputPurpose))
|
||||
|> mapError { _ -> LaunchPrepaidGiveawayError in
|
||||
return .generic
|
||||
|
Loading…
x
Reference in New Issue
Block a user