Skip to content

Commit 8a46bdf

Browse files
committed
Various improvements
1 parent 8f33585 commit 8a46bdf

File tree

4 files changed

+33
-5
lines changed

4 files changed

+33
-5
lines changed

submodules/AccountContext/Sources/Premium.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,3 +347,7 @@ public struct AccountFreezeConfiguration {
347347
public protocol GiftOptionsScreenProtocol {
348348

349349
}
350+
351+
public protocol GiftSetupScreenProtocol {
352+
353+
}

submodules/SettingsUI/Sources/Privacy and Security/LoginEmailSetupController.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ public func loginEmailSetupController(context: AccountContext, blocking: Bool, e
212212
}
213213

214214
dismissEmailControllerImpl = { [weak emailController] in
215+
dismiss()
215216
emailController?.dismiss()
216217
}
217218
return emailController

submodules/TelegramUI/Components/Gifts/GiftSetupScreen/Sources/GiftSetupScreen.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,6 @@ private final class GiftSetupScreenComponent: Component {
584584
}
585585
navigationController.setViewControllers(controllers, animated: true)
586586

587-
588587
if case let .starGift(starGift, _) = component.subject, let perUserLimit = starGift.perUserLimit {
589588
Queue.mainQueue().after(0.5) {
590589
let remains = max(0, perUserLimit.remains - 1)
@@ -2019,7 +2018,7 @@ private final class GiftSetupScreenComponent: Component {
20192018
}
20202019
}
20212020

2022-
public class GiftSetupScreen: ViewControllerComponentContainer {
2021+
public class GiftSetupScreen: ViewControllerComponentContainer, GiftSetupScreenProtocol {
20232022
public enum Subject: Equatable {
20242023
case premium(PremiumGiftProduct)
20252024
case starGift(StarGift.Gift, Bool?)

submodules/TelegramUI/Components/Gifts/GiftViewScreen/Sources/GiftAuctionBidScreen.swift

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1635,7 +1635,9 @@ private final class GiftAuctionBidScreenComponent: Component {
16351635
customUndoText: nil
16361636
),
16371637
position: .bottom,
1638-
action: { _ in return true }
1638+
action: { _ in
1639+
return true
1640+
}
16391641
),
16401642
in: .current
16411643
)
@@ -2018,8 +2020,30 @@ private final class GiftAuctionBidScreenComponent: Component {
20182020
self.loadAcquiredGifts()
20192021
}
20202022
if !isFirstTime {
2021-
self.resetSliderValue()
2022-
self.addSubview(ConfettiView(frame: self.bounds))
2023+
if let bidPeerId = previousState?.myState.bidPeerId, let controller = self.environment?.controller() {
2024+
if let navigationController = controller.navigationController as? NavigationController {
2025+
var controllers = navigationController.viewControllers
2026+
controllers = controllers.filter { !($0 is GiftAuctionBidScreen) && !($0 is GiftSetupScreenProtocol) && !($0 is GiftOptionsScreenProtocol) && !($0 is PeerInfoScreen) && !($0 is ContactSelectionController) }
2027+
2028+
var foundController = false
2029+
for controller in controllers.reversed() {
2030+
if let chatController = controller as? ChatController, case .peer(id: bidPeerId) = chatController.chatLocation {
2031+
chatController.hintPlayNextOutgoingGift()
2032+
foundController = true
2033+
break
2034+
}
2035+
}
2036+
if !foundController {
2037+
let chatController = component.context.sharedContext.makeChatController(context: component.context, chatLocation: .peer(id: bidPeerId), subject: nil, botStart: nil, mode: .standard(.default), params: nil)
2038+
chatController.hintPlayNextOutgoingGift()
2039+
controllers.append(chatController)
2040+
}
2041+
navigationController.setViewControllers(controllers, animated: true)
2042+
}
2043+
} else {
2044+
self.resetSliderValue()
2045+
self.addSubview(ConfettiView(frame: self.bounds))
2046+
}
20232047
}
20242048
}
20252049

0 commit comments

Comments
 (0)