mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-06 03:33:41 +02:00
Fix ton balance update on gift purchase
This commit is contained in:
parent
2c3a49780f
commit
f7901af416
1 changed files with 7 additions and 7 deletions
|
|
@ -1549,19 +1549,14 @@ private final class GiftViewSheetContent: CombinedComponent {
|
|||
if let buyGift = controller.buyGift {
|
||||
buyGiftImpl = { slug, peerId, price in
|
||||
return buyGift(slug, peerId, price)
|
||||
|> afterCompleted {
|
||||
context.starsContext?.load(force: true)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
buyGiftImpl = { slug, peerId, price in
|
||||
return self.context.engine.payments.buyStarGift(slug: slug, peerId: peerId, price: price)
|
||||
|> afterCompleted {
|
||||
context.starsContext?.load(force: true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let finalPrice = acceptedPrice ?? resellAmount
|
||||
self.buyDisposable = (buyGiftImpl(uniqueGift.slug, recipientPeerId, acceptedPrice ?? resellAmount)
|
||||
|> deliverOnMainQueue).start(
|
||||
error: { [weak self] error in
|
||||
|
|
@ -1683,7 +1678,12 @@ private final class GiftViewSheetContent: CombinedComponent {
|
|||
self.updated(transition: .spring(duration: 0.4))
|
||||
|
||||
Queue.mainQueue().after(0.5) {
|
||||
context.starsContext?.load(force: true)
|
||||
switch finalPrice.currency {
|
||||
case .stars:
|
||||
context.starsContext?.load(force: true)
|
||||
case .ton:
|
||||
context.tonContext?.load(force: true)
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue