Fix build

This commit is contained in:
Ilya Laktyushin 2023-07-21 21:03:49 +02:00
parent 84bff91916
commit b6ae46ff28

View File

@ -76,12 +76,6 @@ public final class TextFieldComponent: Component {
} }
} }
public enum FormatMenuAvailability: Equatable {
case available
case locked
case none
}
public let context: AccountContext public let context: AccountContext
public let strings: PresentationStrings public let strings: PresentationStrings
public let externalState: ExternalState public let externalState: ExternalState
@ -89,8 +83,6 @@ public final class TextFieldComponent: Component {
public let textColor: UIColor public let textColor: UIColor
public let insets: UIEdgeInsets public let insets: UIEdgeInsets
public let hideKeyboard: Bool public let hideKeyboard: Bool
public let formatMenuAvailability: FormatMenuAvailability
public let lockedFormatAction: () -> Void
public let present: (ViewController) -> Void public let present: (ViewController) -> Void
public let paste: (PasteData) -> Void public let paste: (PasteData) -> Void
@ -102,8 +94,6 @@ public final class TextFieldComponent: Component {
textColor: UIColor, textColor: UIColor,
insets: UIEdgeInsets, insets: UIEdgeInsets,
hideKeyboard: Bool, hideKeyboard: Bool,
formatMenuAvailability: FormatMenuAvailability,
lockedFormatAction: @escaping () -> Void,
present: @escaping (ViewController) -> Void, present: @escaping (ViewController) -> Void,
paste: @escaping (PasteData) -> Void paste: @escaping (PasteData) -> Void
) { ) {
@ -114,8 +104,6 @@ public final class TextFieldComponent: Component {
self.textColor = textColor self.textColor = textColor
self.insets = insets self.insets = insets
self.hideKeyboard = hideKeyboard self.hideKeyboard = hideKeyboard
self.formatMenuAvailability = formatMenuAvailability
self.lockedFormatAction = lockedFormatAction
self.present = present self.present = present
self.paste = paste self.paste = paste
} }
@ -139,9 +127,6 @@ public final class TextFieldComponent: Component {
if lhs.hideKeyboard != rhs.hideKeyboard { if lhs.hideKeyboard != rhs.hideKeyboard {
return false return false
} }
if lhs.formatMenuAvailability != rhs.formatMenuAvailability {
return false
}
return true return true
} }
@ -402,22 +387,6 @@ public final class TextFieldComponent: Component {
return UIMenu(children: suggestedActions) return UIMenu(children: suggestedActions)
} }
let strings = component.strings let strings = component.strings
if case .none = component.formatMenuAvailability {
return UIMenu(children: suggestedActions)
}
if case .locked = component.formatMenuAvailability {
var updatedActions = suggestedActions
let formatAction = UIAction(title: strings.TextFormat_Format, image: nil) { [weak self] action in
if let self {
self.component?.lockedFormatAction()
}
}
updatedActions.insert(formatAction, at: 1)
return UIMenu(children: updatedActions)
}
var actions: [UIAction] = [ var actions: [UIAction] = [
UIAction(title: strings.TextFormat_Bold, image: nil) { [weak self] action in UIAction(title: strings.TextFormat_Bold, image: nil) { [weak self] action in
if let self { if let self {