mirror of
https://github.com/element-hq/element-web
synced 2024-11-24 02:05:45 +03: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
1 changed files with 7 additions and 0 deletions
|
@ -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 a new issue