Skip to content

Commit 5b65b52

Browse files
author
Isaac
committed
Update
1 parent 54d2b58 commit 5b65b52

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

submodules/TelegramUI/Components/Chat/ChatTextInputPanelNode/Sources/ChatTextInputPanelNode.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,8 @@ public class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDeleg
338338
}
339339
}
340340

341+
public var ignoreInputStateUpdates: Bool = false
342+
341343
override public var context: AccountContext? {
342344
didSet {
343345
self.actionButtons.micButton.statusBarHost = self.context?.sharedContext.mainWindow?.statusBarHost
@@ -362,6 +364,10 @@ public class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDeleg
362364
}
363365

364366
public func updateInputTextState(_ state: ChatTextInputState, keepSendButtonEnabled: Bool, extendedSearchLayout: Bool, accessoryItems: [ChatTextInputAccessoryItem], animated: Bool) {
367+
if self.ignoreInputStateUpdates {
368+
return
369+
}
370+
365371
if let currentState = self.presentationInterfaceState {
366372
var updateAccessoryButtons = false
367373
if accessoryItems.count == self.accessoryItemButtons.count {

submodules/TelegramUI/Sources/ChatController.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10190,6 +10190,8 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
1019010190

1019110191
var clearInputState = false
1019210192
if transferInputState {
10193+
self.chatDisplayNode.textInputPanelNode?.ignoreInputStateUpdates = true
10194+
1019310195
var peerId: PeerId
1019410196
var currentThreadId: Int64?
1019510197
switch self.chatLocation {
@@ -10294,6 +10296,8 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
1029410296
self.currentChatSwitchDirection = nil
1029510297
self.isUpdatingChatLocationThread = false
1029610298

10299+
self.chatDisplayNode.textInputPanelNode?.ignoreInputStateUpdates = false
10300+
1029710301
if clearInputState {
1029810302
//DispatchQueue.main.async { [weak self] in
1029910303
// guard let self else {

0 commit comments

Comments
 (0)