Load data for permalink creators once
This commit is contained in:
parent
ccf292f053
commit
0479901daa
1 changed files with 7 additions and 4 deletions
|
@ -277,7 +277,13 @@ module.exports = React.createClass({
|
||||||
if (this._permalinkCreators[room.roomId]) return this._permalinkCreators[room.roomId];
|
if (this._permalinkCreators[room.roomId]) return this._permalinkCreators[room.roomId];
|
||||||
|
|
||||||
this._permalinkCreators[room.roomId] = new RoomPermalinkCreator(room);
|
this._permalinkCreators[room.roomId] = new RoomPermalinkCreator(room);
|
||||||
|
if (this.state.room && room.roomId === this.state.room.roomId) {
|
||||||
|
// We want to watch for changes in the creator for the primary room in the view, but
|
||||||
|
// don't need to do so for search results.
|
||||||
|
this._permalinkCreators[room.roomId].start();
|
||||||
|
} else {
|
||||||
this._permalinkCreators[room.roomId].load();
|
this._permalinkCreators[room.roomId].load();
|
||||||
|
}
|
||||||
return this._permalinkCreators[room.roomId];
|
return this._permalinkCreators[room.roomId];
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -664,9 +670,6 @@ module.exports = React.createClass({
|
||||||
this._loadMembersIfJoined(room);
|
this._loadMembersIfJoined(room);
|
||||||
this._calculateRecommendedVersion(room);
|
this._calculateRecommendedVersion(room);
|
||||||
this._updateE2EStatus(room);
|
this._updateE2EStatus(room);
|
||||||
|
|
||||||
let creator = this._getPermalinkCreatorForRoom(room);
|
|
||||||
if (!creator.isStarted()) creator.start();
|
|
||||||
},
|
},
|
||||||
|
|
||||||
_calculateRecommendedVersion: async function(room) {
|
_calculateRecommendedVersion: async function(room) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue