diff --git a/src/components/structures/RoomView.js b/src/components/structures/RoomView.js
index e939510c72..2d5cfff8e0 100644
--- a/src/components/structures/RoomView.js
+++ b/src/components/structures/RoomView.js
@@ -1622,6 +1622,7 @@ module.exports = React.createClass({
}
let aux = null;
+ let hideCancel = false;
if (this.state.forwardingEvent !== null) {
aux = ;
} else if (this.state.editingRoomSettings) {
@@ -1629,6 +1630,7 @@ module.exports = React.createClass({
} else if (this.state.uploadingRoomSettings) {
aux = ;
} else if (this.state.searching) {
+ hideCancel = true; // has own cancel
aux = ;
} else if (!myMember || myMember.membership !== "join") {
// We do have a room object for this room, but we're not currently in it.
@@ -1641,6 +1643,7 @@ module.exports = React.createClass({
if (this.props.thirdPartyInvite) {
invitedEmail = this.props.thirdPartyInvite.invitedEmail;
}
+ hideCancel = true;
aux = (
+ onCancelClick={(aux && !hideCancel) ? this.onCancelClick : null}
+ onForgetClick={(myMember && myMember.membership === "leave") ? this.onForgetClick : null}
+ onLeaveClick={(myMember && myMember.membership === "join") ? this.onLeaveClick : null}
+ />
{ auxPanel }
{ topUnreadMessagesBar }
{ messagePanel }