diff --git a/src/components/views/groups/GroupMemberList.js b/src/components/views/groups/GroupMemberList.js
index 511af37166..a5ab22eb0e 100644
--- a/src/components/views/groups/GroupMemberList.js
+++ b/src/components/views/groups/GroupMemberList.js
@@ -59,6 +59,7 @@ export default withMatrixClient(React.createClass({
},
_fetchMembers: function() {
+ if (this._unmounted) return;
this.setState({
members: this._groupStore.getGroupMembers(),
invitedMembers: this._groupStore.getGroupInvitedMembers(),
@@ -105,12 +106,11 @@ export default withMatrixClient(React.createClass({
});
}
- memberList = memberList.map((m) => {
- return (
-
- );
+ const uniqueMembers = {};
+ memberList.forEach((m) => {
+ if (!uniqueMembers[m.userId]) uniqueMembers[m.userId] = m;
});
-
+ memberList = Object.keys(uniqueMembers).map((userId) => uniqueMembers[userId]);
memberList.sort((a, b) => {
// TODO: should put admins at the top: we don't yet have that info
if (a < b) {
@@ -122,10 +122,16 @@ export default withMatrixClient(React.createClass({
}
});
+ const memberTiles = memberList.map((m) => {
+ return (
+
+ );
+ });
+
return
- { memberList }
+ { memberTiles }
;
},
diff --git a/src/components/views/rooms/RoomDetailList.js b/src/components/views/rooms/RoomDetailList.js
index 370bf1bb2d..be9de849e9 100644
--- a/src/components/views/rooms/RoomDetailList.js
+++ b/src/components/views/rooms/RoomDetailList.js
@@ -25,15 +25,28 @@ import MatrixClientPeg from '../../../MatrixClientPeg';
import PropTypes from 'prop-types';
function getDisplayAliasForRoom(room) {
- return room.canonical_alias || (room.aliases ? room.aliases[0] : "");
+ return room.canonicalAlias || (room.aliases ? room.aliases[0] : "");
}
const RoomDetailRow = React.createClass({
+ propTypes: PropTypes.shape({
+ name: PropTypes.string,
+ topic: PropTypes.string,
+ roomId: PropTypes.string,
+ avatarUrl: PropTypes.string,
+ numJoinedMembers: PropTypes.number,
+ canonicalAlias: PropTypes.string,
+ aliases: PropTypes.arrayOf(PropTypes.string),
+
+ worldReadable: PropTypes.bool,
+ guestCanJoin: PropTypes.bool,
+ }),
+
onClick: function(ev) {
ev.preventDefault();
dis.dispatch({
action: 'view_room',
- room_id: this.props.room.room_id,
+ room_id: this.props.room.roomId,
});
},
@@ -50,10 +63,10 @@ const RoomDetailRow = React.createClass({
const name = room.name || getDisplayAliasForRoom(room) || _t('Unnamed room');
const topic = linkifyString(sanitizeHtml(room.topic || ''));
- const guestRead = room.world_readable ? (
+ const guestRead = room.worldReadable ? (
{ _t('World readable') }
) :
;
- const guestJoin = room.guest_can_join ? (
+ const guestJoin = room.guestCanJoin ? (
{ _t('Guests can join') }
) :
;
@@ -62,13 +75,13 @@ const RoomDetailRow = React.createClass({
{ guestJoin }
) :
;
- return
+ return
+ room.avatarUrl, 24, 24, "crop")} />
|
{ name }
@@ -79,7 +92,7 @@ const RoomDetailRow = React.createClass({
{ getDisplayAliasForRoom(room) }
|
- { room.num_joined_members }
+ { room.numJoinedMembers }
|
;
},
@@ -92,13 +105,14 @@ export default React.createClass({
rooms: PropTypes.arrayOf(PropTypes.shape({
name: PropTypes.string,
topic: PropTypes.string,
- room_id: PropTypes.string,
- num_joined_members: PropTypes.number,
- canonical_alias: PropTypes.string,
+ roomId: PropTypes.string,
+ avatarUrl: PropTypes.string,
+ numJoinedMembers: PropTypes.number,
+ canonicalAlias: PropTypes.string,
aliases: PropTypes.arrayOf(PropTypes.string),
- world_readable: PropTypes.bool,
- guest_can_join: PropTypes.bool,
+ worldReadable: PropTypes.bool,
+ guestCanJoin: PropTypes.bool,
})),
},
diff --git a/src/groups.js b/src/groups.js
index 69871c45e9..06db5d067f 100644
--- a/src/groups.js
+++ b/src/groups.js
@@ -43,5 +43,9 @@ export function groupRoomFromApiObject(apiObject) {
roomId: apiObject.room_id,
canonicalAlias: apiObject.canonical_alias,
avatarUrl: apiObject.avatar_url,
+ topic: apiObject.topic,
+ numJoinedMembers: apiObject.num_joined_members,
+ worldReadable: apiObject.world_readable,
+ guestCanJoin: apiObject.guest_can_join,
};
}
diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json
index 1e8a7cadbc..492113989b 100644
--- a/src/i18n/strings/en_EN.json
+++ b/src/i18n/strings/en_EN.json
@@ -54,8 +54,6 @@
"Room name or alias": "Room name or alias",
"Add to community": "Add to community",
"Failed to invite the following users to %(groupId)s:": "Failed to invite the following users to %(groupId)s:",
- "Invites sent": "Invites sent",
- "Your community invitations have been sent.": "Your community invitations have been sent.",
"Failed to invite users to community": "Failed to invite users to community",
"Failed to invite users to %(groupId)s": "Failed to invite users to %(groupId)s",
"Failed to add the following rooms to %(groupId)s:": "Failed to add the following rooms to %(groupId)s:",
@@ -156,6 +154,7 @@
"Message Pinning": "Message Pinning",
"%(displayName)s is typing": "%(displayName)s is typing",
"%(names)s and one other are typing": "%(names)s and one other are typing",
+ "%(names)s and %(count)s others are typing|other": "%(names)s and %(count)s others are typing",
"%(names)s and %(lastPerson)s are typing": "%(names)s and %(lastPerson)s are typing",
"Failure to create room": "Failure to create room",
"Server may be unavailable, overloaded, or you hit a bug.": "Server may be unavailable, overloaded, or you hit a bug.",
@@ -565,6 +564,7 @@
"Custom level": "Custom level",
"Room directory": "Room directory",
"Start chat": "Start chat",
+ "And %(count)s more...|other": "And %(count)s more...",
"ex. @bob:example.com": "ex. @bob:example.com",
"Add User": "Add User",
"Something went wrong!": "Something went wrong!",
diff --git a/src/stores/GroupStoreCache.js b/src/stores/GroupStoreCache.js
index 551b155615..df5ffcda5e 100644
--- a/src/stores/GroupStoreCache.js
+++ b/src/stores/GroupStoreCache.js
@@ -33,8 +33,7 @@ class GroupStoreCache {
}
}
-let singletonGroupStoreCache = null;
-if (!singletonGroupStoreCache) {
- singletonGroupStoreCache = new GroupStoreCache();
+if (global.singletonGroupStoreCache === undefined) {
+ global.singletonGroupStoreCache = new GroupStoreCache();
}
-module.exports = singletonGroupStoreCache;
+export default global.singletonGroupStoreCache;
diff --git a/src/stores/RoomViewStore.js b/src/stores/RoomViewStore.js
index 795345242e..0a8eca8797 100644
--- a/src/stores/RoomViewStore.js
+++ b/src/stores/RoomViewStore.js
@@ -72,6 +72,13 @@ class RoomViewStore extends Store {
case 'view_room':
this._viewRoom(payload);
break;
+ case 'view_my_groups':
+ case 'view_group':
+ this._setState({
+ roomId: null,
+ roomAlias: null,
+ });
+ break;
case 'view_room_error':
this._viewRoomError(payload);
break;