Bot start button improvements

This commit is contained in:
Ilya Laktyushin
2023-03-17 22:55:37 +04:00
parent de8aea109f
commit 25d7aaf7e3
18 changed files with 607 additions and 133 deletions

View File

@@ -233,7 +233,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
private let context: AccountContext
public let chatLocation: ChatLocation
public let subject: ChatControllerSubject?
private let botStart: ChatControllerInitialBotStart?
private var botStart: ChatControllerInitialBotStart?
private var attachBotStart: ChatControllerInitialAttachBotStart?
private var botAppStart: ChatControllerInitialBotAppStart?
@@ -7183,6 +7183,13 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
strongSelf.updateChatPresentationInterfaceState(animated: true, interactive: strongSelf.isViewLoaded && strongSelf.view.window != nil, {
$0.updatedChatHistoryState(state)
})
if let botStart = strongSelf.botStart, case let .loaded(isEmpty) = state {
strongSelf.botStart = nil
if !isEmpty {
strongSelf.startBot(botStart.payload)
}
}
}
})
@@ -9596,6 +9603,8 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
}
}, presentController: { [weak self] controller, arguments in
self?.present(controller, in: .window(.root), with: arguments)
}, presentControllerInCurrent: { [weak self] controller, arguments in
self?.present(controller, in: .current, with: arguments)
}, getNavigationController: { [weak self] in
return self?.navigationController as? NavigationController
}, presentGlobalOverlayController: { [weak self] controller, arguments in
@@ -17670,7 +17679,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
if let controller = controller as? UndoOverlayController {
controller.dismissWithCommitAction()
}
if let controller = controller as? TooltipScreen {
if let controller = controller as? TooltipScreen, !controller.alwaysVisible {
controller.dismiss()
}
return true