further fix for input view not scrollable issue

pull/614/head
Ryan Zhao 2 years ago
parent 5bb287f258
commit 102a29b8e3

@ -95,4 +95,5 @@ protocol ContextMenuActionDelegate : AnyObject {
func save(_ viewItem: ConversationViewItem)
func ban(_ viewItem: ConversationViewItem)
func banAndDeleteAllMessages(_ viewItem: ConversationViewItem)
func contextMenuDismissed()
}

@ -132,6 +132,7 @@ final class ContextMenuVC : UIViewController {
self.timestampLabel.alpha = 0
}, completion: { _ in
self.dismiss()
self.delegate?.contextMenuDismissed()
})
}
}

@ -785,6 +785,10 @@ extension ConversationVC : InputViewDelegate, MessageCellDelegate, ContextMenuAc
alert.addAction(UIAlertAction(title: "Cancel", style: .default, handler: nil))
present(alert, animated: true, completion: nil)
}
func contextMenuDismissed() {
recoverInputView()
}
func handleQuoteViewCancelButtonTapped() {
snInputView.quoteDraftInfo = nil

@ -425,6 +425,7 @@ final class ConversationVC : BaseVC, ConversationViewModelDelegate, OWSConversat
highlightFocusedMessageIfNeeded()
didFinishInitialLayout = true
markAllAsRead()
recoverInputView()
}
override func viewWillDisappear(_ animated: Bool) {
@ -442,9 +443,7 @@ final class ConversationVC : BaseVC, ConversationViewModelDelegate, OWSConversat
}
override func appDidBecomeActive(_ notification: Notification) {
// This is a workaround for an issue where the textview is not scrollable
// after the app goes into background and goes back in foreground.
self.snInputView.text = self.snInputView.text
recoverInputView()
}
deinit {
@ -737,6 +736,14 @@ final class ConversationVC : BaseVC, ConversationViewModelDelegate, OWSConversat
}
}
func recoverInputView() {
// This is a workaround for an issue where the textview is not scrollable
// after the app goes into background and goes back in foreground.
DispatchQueue.main.async {
self.snInputView.text = self.snInputView.text
}
}
func markAllAsRead() {
guard let lastSortID = viewItems.last?.interaction.sortId else { return }
OWSReadReceiptManager.shared().markAsReadLocally(

Loading…
Cancel
Save