mirror of
https://github.com/vector-im/element-web.git
synced 2025-08-30 10:51:13 +02:00
better naming and document method
This commit is contained in:
parent
d276b17c2a
commit
e1b9aa9626
@ -47,7 +47,7 @@ module.exports = React.createClass({
|
|||||||
if (cli.hasLazyLoadMembersEnabled()) {
|
if (cli.hasLazyLoadMembersEnabled()) {
|
||||||
// true means will not show a spinner but the
|
// true means will not show a spinner but the
|
||||||
// known members so far if not joined
|
// known members so far if not joined
|
||||||
this._loadMembersIfNeeded(true);
|
this._waitForMembersIfJoinedAndLL(true);
|
||||||
cli.on("Room.myMembership", this.onMyMembership);
|
cli.on("Room.myMembership", this.onMyMembership);
|
||||||
} else {
|
} else {
|
||||||
this._listenForMembersChanges();
|
this._listenForMembersChanges();
|
||||||
@ -93,7 +93,12 @@ module.exports = React.createClass({
|
|||||||
this._updateList.cancelPendingCall();
|
this._updateList.cancelPendingCall();
|
||||||
},
|
},
|
||||||
|
|
||||||
_loadMembersIfNeeded: async function(initial) {
|
/**
|
||||||
|
* If lazy loading is enabled, either:
|
||||||
|
* show a spinner and load the members if the user is joined,
|
||||||
|
* or show the members available so far if initial=true
|
||||||
|
*/
|
||||||
|
_waitForMembersIfJoinedAndLL: async function(initial) {
|
||||||
const cli = MatrixClientPeg.get();
|
const cli = MatrixClientPeg.get();
|
||||||
if (cli.hasLazyLoadMembersEnabled()) {
|
if (cli.hasLazyLoadMembersEnabled()) {
|
||||||
const cli = MatrixClientPeg.get();
|
const cli = MatrixClientPeg.get();
|
||||||
@ -153,12 +158,12 @@ module.exports = React.createClass({
|
|||||||
// also when peeking, we need to await the members being loaded
|
// also when peeking, we need to await the members being loaded
|
||||||
// before showing them.
|
// before showing them.
|
||||||
|
|
||||||
this._loadMembersIfNeeded();
|
this._waitForMembersIfJoinedAndLL();
|
||||||
},
|
},
|
||||||
|
|
||||||
onMyMembership: function(room, membership, oldMembership) {
|
onMyMembership: function(room, membership, oldMembership) {
|
||||||
if (room.roomId === this.props.roomId && membership === "join") {
|
if (room.roomId === this.props.roomId && membership === "join") {
|
||||||
this._loadMembersIfNeeded();
|
this._waitForMembersIfJoinedAndLL();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user