mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
Update
This commit is contained in:
@@ -112,6 +112,7 @@ public final class ChatTextInputPanelComponent: Component {
|
||||
let hideKeyboard: Bool
|
||||
let insets: UIEdgeInsets
|
||||
let maxHeight: CGFloat
|
||||
let maxLength: Int?
|
||||
let sendAction: (() -> Void)?
|
||||
let sendContextAction: ((UIView, ContextGesture) -> Void)?
|
||||
|
||||
@@ -130,6 +131,7 @@ public final class ChatTextInputPanelComponent: Component {
|
||||
hideKeyboard: Bool,
|
||||
insets: UIEdgeInsets,
|
||||
maxHeight: CGFloat,
|
||||
maxLength: Int?,
|
||||
sendAction: (() -> Void)?,
|
||||
sendContextAction: ((UIView, ContextGesture) -> Void)?
|
||||
) {
|
||||
@@ -147,6 +149,7 @@ public final class ChatTextInputPanelComponent: Component {
|
||||
self.hideKeyboard = hideKeyboard
|
||||
self.insets = insets
|
||||
self.maxHeight = maxHeight
|
||||
self.maxLength = maxLength
|
||||
self.sendAction = sendAction
|
||||
self.sendContextAction = sendContextAction
|
||||
}
|
||||
@@ -194,6 +197,9 @@ public final class ChatTextInputPanelComponent: Component {
|
||||
if lhs.maxHeight != rhs.maxHeight {
|
||||
return false
|
||||
}
|
||||
if lhs.maxLength != rhs.maxLength {
|
||||
return false
|
||||
}
|
||||
if (lhs.sendAction == nil) != (rhs.sendAction == nil) {
|
||||
return false
|
||||
}
|
||||
@@ -783,6 +789,7 @@ public final class ChatTextInputPanelComponent: Component {
|
||||
}
|
||||
|
||||
panelNode.customSendColor = component.sendColor
|
||||
panelNode.customInputTextMaxLength = component.maxLength
|
||||
|
||||
if let resetInputState = component.externalState.resetInputState {
|
||||
component.externalState.resetInputState = nil
|
||||
|
||||
@@ -387,6 +387,7 @@ public class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDeleg
|
||||
public var customLeftAction: LeftAction?
|
||||
public var customRightAction: RightAction?
|
||||
public var customSendColor: UIColor?
|
||||
public var customInputTextMaxLength: Int?
|
||||
|
||||
private var starReactionButton: ComponentView<Empty>?
|
||||
|
||||
@@ -3580,7 +3581,9 @@ public class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDeleg
|
||||
|
||||
private func updateCounterTextNode(transition: ContainedViewLayoutTransition) {
|
||||
var inputTextMaxLength: Int32?
|
||||
if let presentationInterfaceState = self.presentationInterfaceState {
|
||||
if let customInputTextMaxLength = self.customInputTextMaxLength {
|
||||
inputTextMaxLength = Int32(customInputTextMaxLength)
|
||||
} else if let presentationInterfaceState = self.presentationInterfaceState {
|
||||
if let editMessage = presentationInterfaceState.interfaceState.editMessage, let inputTextMaxLengthValue = editMessage.inputTextMaxLength {
|
||||
inputTextMaxLength = inputTextMaxLengthValue
|
||||
} else if case let .customChatContents(customChatContents) = presentationInterfaceState.subject, case .businessLinkSetup = customChatContents.kind {
|
||||
|
||||
Reference in New Issue
Block a user