Various fixes

This commit is contained in:
Ilya Laktyushin 2025-09-01 03:30:20 +04:00
parent b41ec12024
commit 7b3cf92720
2 changed files with 8 additions and 1 deletions

View File

@ -1678,6 +1678,8 @@ func _internal_sendStarsPaymentForm(account: Account, formId: Int64, source: Bot
return .fail(.alreadyPaid)
} else if error.errorDescription == "STARGIFT_USAGE_LIMITED" {
return .fail(.starGiftOutOfStock)
} else if error.errorDescription == "STARGIFT_USER_USAGE_LIMITED" {
return .fail(.starGiftUserLimit)
}
return .fail(.generic)
}

View File

@ -477,7 +477,12 @@ final class GiftSetupScreenComponent: Component {
case .starGiftUserLimit:
if let perUserLimit, let giftFile {
let text = presentationData.strings.Gift_Options_Gift_BuyLimitReached(perUserLimit)
let undoController = UndoOverlayController(presentationData: presentationData, content: .sticker(context: component.context, file: giftFile, loop: true, title: nil, text: text, undoText: nil, customAction: nil), action: { _ in return false })
let undoController = UndoOverlayController(
presentationData: presentationData,
content: .sticker(context: component.context, file: giftFile, loop: true, title: nil, text: text, undoText: nil, customAction: nil),
elevatedLayout: true,
action: { _ in return false }
)
controller.present(undoController, in: .current)
return
}