You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-05 23:10:41 +03:00
Load data for permalink creators once
This commit is contained in:
@@ -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);
|
||||||
this._permalinkCreators[room.roomId].load();
|
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();
|
||||||
|
}
|
||||||
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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user