Various fixes

This commit is contained in:
Ilya Laktyushin
2023-11-02 16:38:20 +04:00
parent 19007dfbcb
commit 5b6f79e6f5
4 changed files with 21 additions and 11 deletions

View File

@@ -904,8 +904,15 @@ public func createGiveawayController(context: AccountContext, updatedPresentatio
var selectedProduct: PremiumGiftProduct?
let selectedMonths = state.selectedMonths ?? 12
if let product = products.first(where: { $0.months == selectedMonths && $0.giftOption.users == state.subscriptions }) {
selectedProduct = product
switch state.mode {
case .giveaway:
if let product = products.first(where: { $0.months == selectedMonths && $0.giftOption.users == state.subscriptions }) {
selectedProduct = product
}
case .gift:
if let product = products.first(where: { $0.months == selectedMonths && $0.giftOption.users == 1 }) {
selectedProduct = product
}
}
guard let selectedProduct else {