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:
@@ -898,13 +898,7 @@ public func createGiveawayController(context: AccountContext, updatedPresentatio
|
||||
let state = stateValue.with { $0 }
|
||||
|
||||
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
|
||||
|
||||
updateState { state in
|
||||
var updatedState = state
|
||||
updatedState.updating = true
|
||||
return updatedState
|
||||
}
|
||||
|
||||
|
||||
switch subject {
|
||||
case .generic:
|
||||
guard let products = productsValue.with({ $0 }), !products.isEmpty else {
|
||||
@@ -935,6 +929,12 @@ public func createGiveawayController(context: AccountContext, updatedPresentatio
|
||||
return
|
||||
}
|
||||
|
||||
updateState { state in
|
||||
var updatedState = state
|
||||
updatedState.updating = true
|
||||
return updatedState
|
||||
}
|
||||
|
||||
let (currency, amount) = selectedProduct.storeProduct.priceCurrencyAndAmount
|
||||
|
||||
let purpose: AppStoreTransactionPurpose
|
||||
@@ -1033,6 +1033,12 @@ public func createGiveawayController(context: AccountContext, updatedPresentatio
|
||||
}
|
||||
})
|
||||
case let .prepaid(prepaidGiveaway):
|
||||
updateState { state in
|
||||
var updatedState = state
|
||||
updatedState.updating = true
|
||||
return updatedState
|
||||
}
|
||||
|
||||
let _ = (context.engine.payments.launchPrepaidGiveaway(peerId: peerId, id: prepaidGiveaway.id, additionalPeerIds: state.channels.filter { $0 != peerId }, countries: state.countries, onlyNewSubscribers: state.onlyNewEligible, randomId: Int64.random(in: .min ..< .max), untilDate: state.time)
|
||||
|> deliverOnMainQueue).startStandalone(completed: {
|
||||
if let controller, let navigationController = controller.navigationController as? NavigationController {
|
||||
|
||||
Reference in New Issue
Block a user