mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 06:35:51 +00:00
Various fixes
This commit is contained in:
@@ -20,6 +20,7 @@ private final class FactCheckAlertContentNode: AlertContentNode {
|
||||
private var presentationTheme: PresentationTheme
|
||||
private let strings: PresentationStrings
|
||||
private let text: String
|
||||
private let initialValue: String
|
||||
|
||||
private let titleView = ComponentView<Empty>()
|
||||
|
||||
@@ -58,6 +59,7 @@ private final class FactCheckAlertContentNode: AlertContentNode {
|
||||
self.presentationTheme = presentationTheme
|
||||
self.strings = strings
|
||||
self.text = text
|
||||
self.initialValue = value
|
||||
|
||||
if !value.isEmpty {
|
||||
self.inputFieldExternalState.initialText = chatInputStateStringWithAppliedEntities(value, entities: entities)
|
||||
@@ -271,7 +273,23 @@ private final class FactCheckAlertContentNode: AlertContentNode {
|
||||
}
|
||||
|
||||
if let lastActionNode = self.actionNodes.last {
|
||||
lastActionNode.actionEnabled = self.inputFieldExternalState.hasText
|
||||
if self.initialValue.isEmpty {
|
||||
lastActionNode.actionEnabled = self.inputFieldExternalState.hasText
|
||||
} else {
|
||||
if self.inputFieldExternalState.hasText {
|
||||
lastActionNode.action = TextAlertAction(
|
||||
type: .defaultAction,
|
||||
title: self.strings.Common_Done,
|
||||
action: lastActionNode.action.action
|
||||
)
|
||||
} else {
|
||||
lastActionNode.action = TextAlertAction(
|
||||
type: .defaultDestructiveAction,
|
||||
title: self.strings.FactCheck_Remove,
|
||||
action: lastActionNode.action.action
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let resultSize = CGSize(width: resultWidth, height: titleSize.height + spacing + inputFieldSize.height + 17.0 + actionsHeight + insets.top + insets.bottom)
|
||||
|
||||
Reference in New Issue
Block a user