show message input box when permission is changed in a conversation

pull/995/head
Ryan ZHAO 9 months ago
parent 2642cc785b
commit 6758ad010e

@ -804,9 +804,11 @@ extension ConversationVC:
} }
func hideInputAccessoryView() { func hideInputAccessoryView() {
DispatchQueue.main.async {
self.inputAccessoryView?.isHidden = true self.inputAccessoryView?.isHidden = true
self.inputAccessoryView?.alpha = 0 self.inputAccessoryView?.alpha = 0
} }
}
func showInputAccessoryView() { func showInputAccessoryView() {
UIView.animate(withDuration: 0.25, animations: { UIView.animate(withDuration: 0.25, animations: {

@ -74,9 +74,11 @@ final class ConversationVC: BaseVC, LibSessionRespondingViewController, Conversa
} }
override var inputAccessoryView: UIView? { override var inputAccessoryView: UIView? {
guard viewModel.threadData.canWrite else { return nil } return (
(viewModel.threadData.canWrite && isShowingSearchUI) ?
return (isShowingSearchUI ? searchController.resultsBar : snInputView) searchController.resultsBar :
snInputView
)
} }
/// The height of the visible part of the table view, i.e. the distance from the navigation bar (where the table view's origin is) /// The height of the visible part of the table view, i.e. the distance from the navigation bar (where the table view's origin is)
@ -750,6 +752,12 @@ final class ConversationVC: BaseVC, LibSessionRespondingViewController, Conversa
viewModel.threadData.threadIsMessageRequest != updatedThreadData.threadIsMessageRequest || viewModel.threadData.threadIsMessageRequest != updatedThreadData.threadIsMessageRequest ||
viewModel.threadData.threadRequiresApproval != updatedThreadData.threadRequiresApproval viewModel.threadData.threadRequiresApproval != updatedThreadData.threadRequiresApproval
{ {
if updatedThreadData.canWrite {
self.showInputAccessoryView()
} else {
self.hideInputAccessoryView()
}
let messageRequestsViewWasVisible: Bool = (self.messageRequestFooterView.isHidden == false) let messageRequestsViewWasVisible: Bool = (self.messageRequestFooterView.isHidden == false)
UIView.animate(withDuration: 0.3) { [weak self] in UIView.animate(withDuration: 0.3) { [weak self] in

Loading…
Cancel
Save