@@ -1528,10 +1528,15 @@ private final class GiftAuctionBidScreenComponent: Component {
15281528 title: nil ,
15291529 text: presentationData. strings. Gift_AuctionBid_AddMoreStars ( presentationData. strings. Gift_AuctionBid_AddMoreStars_Stars ( Int32 ( clamping: myMinBidAmount - myBidAmount) ) ) . string,
15301530 timeout: nil ,
1531- customUndoText: nil
1531+ customUndoText: presentationData . strings . Gift_AuctionBid_AddMoreStars_Set
15321532 ) ,
15331533 position: . bottom,
1534- action: { _ in return true }
1534+ action: { [ weak self] action in
1535+ if let self, case . undo = action {
1536+ self . resetSliderValue ( component: self . component, forceMinimum: true )
1537+ }
1538+ return true
1539+ }
15351540 ) ,
15361541 in: . current
15371542 )
@@ -1613,8 +1618,28 @@ private final class GiftAuctionBidScreenComponent: Component {
16131618 return
16141619 }
16151620
1621+ HapticFeedback ( ) . error ( )
1622+
1623+ let currentValue = self . amount. realValue
16161624 self . component? . context. starsContext? . load ( force: true )
1617- self . resetSliderValue ( )
1625+ self . resetSliderValue ( component: self . component, forceMinimum: true )
1626+
1627+ if self . amount. realValue > currentValue {
1628+ controller. present (
1629+ UndoOverlayController (
1630+ presentationData: presentationData,
1631+ content: . info(
1632+ title: nil ,
1633+ text: presentationData. strings. Gift_AuctionBid_MinimumBidIncreased ( presentationData. strings. Gift_AuctionBid_AddMoreStars_Stars ( Int32 ( clamping: self . amount. realValue) ) ) . string,
1634+ timeout: nil ,
1635+ customUndoText: nil
1636+ ) ,
1637+ position: . bottom,
1638+ action: { _ in return true }
1639+ ) ,
1640+ in: . current
1641+ )
1642+ }
16181643
16191644 Queue . mainQueue ( ) . after ( 0.1 ) {
16201645 self . isLoading = false
@@ -1826,7 +1851,7 @@ private final class GiftAuctionBidScreenComponent: Component {
18261851 self . environment? . controller ( ) ? . present ( controller, in: . window( . root) )
18271852 }
18281853
1829- func resetSliderValue( component: GiftAuctionBidScreenComponent ? = nil ) {
1854+ func resetSliderValue( component: GiftAuctionBidScreenComponent ? = nil , forceMinimum : Bool = false ) {
18301855 guard let state = self . giftAuctionState else {
18311856 return
18321857 }
@@ -1839,16 +1864,13 @@ private final class GiftAuctionBidScreenComponent: Component {
18391864 }
18401865 }
18411866 var currentValue = max ( Int ( minBidAmount) , 100 )
1867+ var minAllowedRealValue : Int64 = minBidAmount
18421868 if let myBidAmount = state. myState. bidAmount {
1843- if let component, let bidPeerId = state. myState. bidPeerId, bidPeerId != component. toPeerId, let myMinBidAmount = state. myState. minBidAmount {
1869+ if let component, let bidPeerId = state. myState. bidPeerId, bidPeerId != component. toPeerId || forceMinimum , let myMinBidAmount = state. myState. minBidAmount {
18441870 currentValue = Int ( myMinBidAmount)
18451871 } else {
18461872 currentValue = Int ( myBidAmount)
18471873 }
1848- }
1849-
1850- var minAllowedRealValue : Int64 = minBidAmount
1851- if let myBidAmount = state. myState. bidAmount {
18521874 minAllowedRealValue = myBidAmount
18531875 }
18541876
0 commit comments