This commit is contained in:
Isaac 2025-09-30 22:01:43 +08:00
parent 54d2b58eb3
commit 5b65b52c61
2 changed files with 10 additions and 0 deletions

View File

@ -338,6 +338,8 @@ public class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDeleg
}
}
public var ignoreInputStateUpdates: Bool = false
override public var context: AccountContext? {
didSet {
self.actionButtons.micButton.statusBarHost = self.context?.sharedContext.mainWindow?.statusBarHost
@ -362,6 +364,10 @@ public class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDeleg
}
public func updateInputTextState(_ state: ChatTextInputState, keepSendButtonEnabled: Bool, extendedSearchLayout: Bool, accessoryItems: [ChatTextInputAccessoryItem], animated: Bool) {
if self.ignoreInputStateUpdates {
return
}
if let currentState = self.presentationInterfaceState {
var updateAccessoryButtons = false
if accessoryItems.count == self.accessoryItemButtons.count {

View File

@ -10190,6 +10190,8 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
var clearInputState = false
if transferInputState {
self.chatDisplayNode.textInputPanelNode?.ignoreInputStateUpdates = true
var peerId: PeerId
var currentThreadId: Int64?
switch self.chatLocation {
@ -10294,6 +10296,8 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
self.currentChatSwitchDirection = nil
self.isUpdatingChatLocationThread = false
self.chatDisplayNode.textInputPanelNode?.ignoreInputStateUpdates = false
if clearInputState {
//DispatchQueue.main.async { [weak self] in
// guard let self else {