mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-02 00:17:02 +00:00
Fixed message editing key shortcut
This commit is contained in:
parent
de0432d66a
commit
c0d2c663ef
@ -6843,23 +6843,22 @@ public final class ChatController: TelegramController, GalleryHiddenMediaTarget,
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
|
}
|
||||||
|
|
||||||
if let message = self.chatDisplayNode.historyNode.latestMessageInCurrentHistoryView(), !message.flags.contains(.Incoming) {
|
var canEdit = false
|
||||||
inputShortcuts.append(KeyShortcut(input: UIKeyInputUpArrow, action: { [weak self] in
|
self.updateChatPresentationInterfaceState(animated: false, interactive: false, { state in
|
||||||
if let strongSelf = self {
|
if state.interfaceState.effectiveInputState.inputText.length == 0 && state.interfaceState.editMessage == nil {
|
||||||
var canEdit = false
|
canEdit = true
|
||||||
strongSelf.updateChatPresentationInterfaceState(animated: true, interactive: true, { state in
|
|
||||||
if state.interfaceState.effectiveInputState.inputText.length == 0 && state.interfaceState.editMessage == nil {
|
|
||||||
canEdit = true
|
|
||||||
}
|
|
||||||
return state
|
|
||||||
})
|
|
||||||
if canEdit {
|
|
||||||
strongSelf.interfaceInteraction?.setupEditMessage(message.id)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}))
|
|
||||||
}
|
}
|
||||||
|
return state
|
||||||
|
})
|
||||||
|
|
||||||
|
if canEdit, let message = self.chatDisplayNode.historyNode.firstMessageForEditInCurrentHistoryView() {
|
||||||
|
inputShortcuts.append(KeyShortcut(input: UIKeyInputUpArrow, action: { [weak self] in
|
||||||
|
if let strongSelf = self {
|
||||||
|
strongSelf.interfaceInteraction?.setupEditMessage(message.id)
|
||||||
|
}
|
||||||
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
let otherShortcuts: [KeyShortcut] = [
|
let otherShortcuts: [KeyShortcut] = [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user