mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-16 21:24:59 +08:00
Merge pull request #196 from matrix-org/matthew/bug186
hopefully fix bug186 by ensuring room members never have null users
This commit is contained in:
commit
ed4774efdb
@ -246,6 +246,13 @@ module.exports = React.createClass({
|
|||||||
|
|
||||||
// XXX: evil hack until SYJS-28 is fixed
|
// XXX: evil hack until SYJS-28 is fixed
|
||||||
Object.keys(all_members).map(function(userId) {
|
Object.keys(all_members).map(function(userId) {
|
||||||
|
// work around a race where you might have a room member object
|
||||||
|
// before the user object exists. This may or may not cause
|
||||||
|
// https://github.com/vector-im/vector-web/issues/186
|
||||||
|
if (all_members[userId].user === null) {
|
||||||
|
all_members[userId].user = MatrixClientPeg.get().getUser(userId);
|
||||||
|
}
|
||||||
|
|
||||||
if (all_members[userId].user && !all_members[userId].user.lastPresenceTs) {
|
if (all_members[userId].user && !all_members[userId].user.lastPresenceTs) {
|
||||||
all_members[userId].user.lastPresenceTs = Date.now();
|
all_members[userId].user.lastPresenceTs = Date.now();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user