Don't restore keyboard after CVC message context menu if the menu item presented a VC.

This commit is contained in:
Matthew Chen 2021-08-30 13:35:54 -03:00
parent c474d3f07c
commit 2bf974bc58
3 changed files with 13 additions and 2 deletions

View File

@ -323,10 +323,17 @@ extension ConversationViewController: ContextMenuInteractionDelegate {
if let contextInteraction = interaction as? ChatHistoryContextMenuInteraction, let cell = contextInteraction.view as? CVCell, let componentView = cell.componentView {
componentView.contextMenuPresentationDidEnd?()
// Restore the keyboard unless the context menu item presented
// a view controller.
if contextInteraction.keyboardWasActive {
popKeyBoard()
if self.presentedViewController == nil {
popKeyBoard()
} else {
// If we're not going to restore the keyboard, update
// chat history layout.
self.loadCoordinator.enqueueReload()
}
}
}
collectionViewActiveContextMenuInteraction = nil

View File

@ -81,6 +81,8 @@ extension ConversationViewController: MessageActionsDelegate {
}
func messageActionsForwardItem(_ itemViewModel: CVItemViewModelImpl) {
AssertIsOnMainThread()
ForwardMessageViewController.present(forItemViewModels: [itemViewModel],
from: self,
delegate: self)

View File

@ -362,6 +362,8 @@ extension ConversationViewController {
}
func didTapForwardSelectedItems() {
AssertIsOnMainThread()
let selectionItems = self.selectionState.selectionItems
guard !selectionItems.isEmpty else {
owsFailDebug("Invalid selection.")