Room preview unexpectedly triggering within the room (#6255)

* Room preview unexpectedly triggering within the room

- The room creation modal is now triggered only when the user taps the room name label
- Also fix empty room creation modal view
This commit is contained in:
Gil Eluard
2022-06-10 10:41:37 +02:00
committed by GitHub
parent 51b2a1ce4d
commit ced9858a06
7 changed files with 61 additions and 27 deletions
@@ -49,6 +49,7 @@ final class RoomCreationIntroCellContentView: UIView, NibLoadable, Themable {
// MARK: Public
var didTapTopic: (() -> Void)?
var didTapRoomName: (() -> Void)?
var didTapAddParticipants: (() -> Void)?
// MARK: - Setup
@@ -186,9 +187,13 @@ final class RoomCreationIntroCellContentView: UIView, NibLoadable, Themable {
}
private func setupInformationTextTapGestureRecognizer() {
let tapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(handleInformationTextTap(_:)))
var tapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(handleInformationTextTap(_:)))
self.informationLabel.isUserInteractionEnabled = true
self.informationLabel.addGestureRecognizer(tapGestureRecognizer)
tapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(handleRoomNameTextTap(_:)))
self.titleLabel.isUserInteractionEnabled = true
self.titleLabel.addGestureRecognizer(tapGestureRecognizer)
}
@objc private func handleInformationTextTap(_ gestureRecognizer: UITapGestureRecognizer) {
@@ -204,6 +209,10 @@ final class RoomCreationIntroCellContentView: UIView, NibLoadable, Themable {
}
}
@objc private func handleRoomNameTextTap(_ gestureRecognizer: UITapGestureRecognizer) {
self.didTapRoomName?()
}
@objc private func socialButtonAction(_ sender: UIButton) {
self.didTapAddParticipants?()
}