mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Psa-related fixes
This commit is contained in:
@@ -60,8 +60,8 @@ public class ImmediateTextNode: TextNode {
|
||||
}
|
||||
}
|
||||
|
||||
public var tapAttributeAction: (([NSAttributedString.Key: Any]) -> Void)?
|
||||
public var longTapAttributeAction: (([NSAttributedString.Key: Any]) -> Void)?
|
||||
public var tapAttributeAction: (([NSAttributedString.Key: Any], Int) -> Void)?
|
||||
public var longTapAttributeAction: (([NSAttributedString.Key: Any], Int) -> Void)?
|
||||
|
||||
public func makeCopy() -> TextNode {
|
||||
let node = TextNode()
|
||||
@@ -179,12 +179,12 @@ public class ImmediateTextNode: TextNode {
|
||||
if let (gesture, location) = recognizer.lastRecognizedGestureAndLocation {
|
||||
switch gesture {
|
||||
case .tap:
|
||||
if let (_, attributes) = self.attributesAtPoint(CGPoint(x: location.x, y: location.y)) {
|
||||
self.tapAttributeAction?(attributes)
|
||||
if let (index, attributes) = self.attributesAtPoint(CGPoint(x: location.x, y: location.y)) {
|
||||
self.tapAttributeAction?(attributes, index)
|
||||
}
|
||||
case .longTap:
|
||||
if let (_, attributes) = self.attributesAtPoint(CGPoint(x: location.x, y: location.y)) {
|
||||
self.longTapAttributeAction?(attributes)
|
||||
if let (index, attributes) = self.attributesAtPoint(CGPoint(x: location.x, y: location.y)) {
|
||||
self.longTapAttributeAction?(attributes, index)
|
||||
}
|
||||
default:
|
||||
break
|
||||
|
||||
@@ -147,7 +147,7 @@ public final class TextAlertContentNode: AlertContentNode {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
self.textNode.tapAttributeAction = { attributes in
|
||||
self.textNode.tapAttributeAction = { attributes, _ in
|
||||
if let value = attributes[attribute] {
|
||||
textAttributeAction(value)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user