Various improvements

This commit is contained in:
Ilya Laktyushin
2023-10-22 13:52:38 +04:00
parent b5bede3d8b
commit df505a7b62
28 changed files with 292 additions and 275 deletions

View File

@@ -191,7 +191,7 @@ final class UndoOverlayControllerNode: ViewControllerTracingNode {
if text.contains("](") {
isUserInteractionEnabled = true
}
case let .succeed(text, timeout):
case let .succeed(text, timeout, customUndoText):
self.avatarNode = nil
self.iconNode = nil
self.iconCheckNode = nil
@@ -203,9 +203,14 @@ final class UndoOverlayControllerNode: ViewControllerTracingNode {
let attributedText = parseMarkdownIntoAttributedString(text, attributes: MarkdownAttributes(body: body, bold: bold, link: body, linkAttribute: { _ in return nil }), textAlignment: .natural)
self.textNode.attributedText = attributedText
self.textNode.maximumNumberOfLines = 5
displayUndo = false
if let customUndoText {
undoText = customUndoText
displayUndo = true
} else {
displayUndo = false
}
self.originalRemainingSeconds = timeout ?? 3
case let .info(title, text, timeout):
case let .info(title, text, timeout, customUndoText):
self.avatarNode = nil
self.iconNode = nil
self.iconCheckNode = nil
@@ -224,7 +229,12 @@ final class UndoOverlayControllerNode: ViewControllerTracingNode {
}), textAlignment: .natural)
self.textNode.attributedText = attributedText
self.textNode.maximumNumberOfLines = 10
displayUndo = false
if let customUndoText {
undoText = customUndoText
displayUndo = true
} else {
displayUndo = false
}
if let timeout {
self.originalRemainingSeconds = timeout
} else {