show message input box when permission is changed in a conversation

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

@ -804,8 +804,10 @@ extension ConversationVC:
}
func hideInputAccessoryView() {
self.inputAccessoryView?.isHidden = true
self.inputAccessoryView?.alpha = 0
DispatchQueue.main.async {
self.inputAccessoryView?.isHidden = true
self.inputAccessoryView?.alpha = 0
}
}
func showInputAccessoryView() {

@ -74,9 +74,11 @@ final class ConversationVC: BaseVC, LibSessionRespondingViewController, Conversa
}
override var inputAccessoryView: UIView? {
guard viewModel.threadData.canWrite else { return nil }
return (isShowingSearchUI ? searchController.resultsBar : snInputView)
return (
(viewModel.threadData.canWrite && isShowingSearchUI) ?
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)
@ -750,6 +752,12 @@ final class ConversationVC: BaseVC, LibSessionRespondingViewController, Conversa
viewModel.threadData.threadIsMessageRequest != updatedThreadData.threadIsMessageRequest ||
viewModel.threadData.threadRequiresApproval != updatedThreadData.threadRequiresApproval
{
if updatedThreadData.canWrite {
self.showInputAccessoryView()
} else {
self.hideInputAccessoryView()
}
let messageRequestsViewWasVisible: Bool = (self.messageRequestFooterView.isHidden == false)
UIView.animate(withDuration: 0.3) { [weak self] in

Loading…
Cancel
Save