From ff9141e424777ea7f052d93876393cb36da87964 Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Tue, 30 May 2017 11:20:41 +0100
Subject: [PATCH 1/3] add a hideCancel flag as some things have own cancel etc
on RoomHeader
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---
src/components/structures/RoomView.js | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
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 }
From baba2e12e297f4f87aaea5fcf5fb145ec9c03882 Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Tue, 30 May 2017 11:21:33 +0100
Subject: [PATCH 2/3] fix weird indentation
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---
src/components/structures/RoomView.js | 77 +++++++++++++--------------
1 file changed, 38 insertions(+), 39 deletions(-)
diff --git a/src/components/structures/RoomView.js b/src/components/structures/RoomView.js
index 2d5cfff8e0..817fe42e94 100644
--- a/src/components/structures/RoomView.js
+++ b/src/components/structures/RoomView.js
@@ -1496,49 +1496,48 @@ module.exports = React.createClass({
const TimelinePanel = sdk.getComponent("structures.TimelinePanel");
if (!this.state.room) {
- if (this.state.roomLoading) {
- return (
-
-
-
- );
+ if (this.state.roomLoading) {
+ return (
+
+
+
+ );
+ } else {
+ var inviterName = undefined;
+ if (this.props.oobData) {
+ inviterName = this.props.oobData.inviterName;
+ }
+ var invitedEmail = undefined;
+ if (this.props.thirdPartyInvite) {
+ invitedEmail = this.props.thirdPartyInvite.invitedEmail;
}
- else {
- var inviterName = undefined;
- if (this.props.oobData) {
- inviterName = this.props.oobData.inviterName;
- }
- var invitedEmail = undefined;
- if (this.props.thirdPartyInvite) {
- invitedEmail = this.props.thirdPartyInvite.invitedEmail;
- }
- // We have no room object for this room, only the ID.
- // We've got to this room by following a link, possibly a third party invite.
- var room_alias = this.props.roomAddress[0] == '#' ? this.props.roomAddress : null;
- return (
-
+ );
+ }
}
var myUserId = MatrixClientPeg.get().credentials.userId;
From ee6789ed15d76daac9aa18271ffec6515bf3b34b Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Tue, 30 May 2017 11:22:27 +0100
Subject: [PATCH 3/3] change aux order so room settings is top most, forwarding
could go weird if you clicked roomsettings whilst forwarding
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---
src/components/structures/RoomView.js | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/components/structures/RoomView.js b/src/components/structures/RoomView.js
index 817fe42e94..77ea8d945a 100644
--- a/src/components/structures/RoomView.js
+++ b/src/components/structures/RoomView.js
@@ -1622,12 +1622,12 @@ module.exports = React.createClass({
let aux = null;
let hideCancel = false;
- if (this.state.forwardingEvent !== null) {
- aux = ;
- } else if (this.state.editingRoomSettings) {
+ if (this.state.editingRoomSettings) {
aux = ;
} else if (this.state.uploadingRoomSettings) {
aux = ;
+ } else if (this.state.forwardingEvent !== null) {
+ aux = ;
} else if (this.state.searching) {
hideCancel = true; // has own cancel
aux = ;