Fix this/self fail in LeftPanel
This commit is contained in:
parent
11d039477d
commit
534f9277d4
2 changed files with 12 additions and 7 deletions
|
@ -191,6 +191,7 @@ module.exports = React.createClass({
|
||||||
this.queryChangedDebouncer = setTimeout(() => {
|
this.queryChangedDebouncer = setTimeout(() => {
|
||||||
// Only do search if there is something to search
|
// Only do search if there is something to search
|
||||||
if (query.length > 0 && query != '@') {
|
if (query.length > 0 && query != '@') {
|
||||||
|
performance.mark('start');
|
||||||
// Weighted keys prefer to match userIds when first char is @
|
// Weighted keys prefer to match userIds when first char is @
|
||||||
this._fuse.options.keys = [{
|
this._fuse.options.keys = [{
|
||||||
name: 'displayName',
|
name: 'displayName',
|
||||||
|
@ -199,6 +200,7 @@ module.exports = React.createClass({
|
||||||
name: 'userId',
|
name: 'userId',
|
||||||
weight: query[0] === '@' ? 0.9 : 0.1,
|
weight: query[0] === '@' ? 0.9 : 0.1,
|
||||||
}];
|
}];
|
||||||
|
performance.mark('middle');
|
||||||
queryList = this._fuse.search(query).map((user) => {
|
queryList = this._fuse.search(query).map((user) => {
|
||||||
// Return objects, structure of which is defined
|
// Return objects, structure of which is defined
|
||||||
// by InviteAddressType
|
// by InviteAddressType
|
||||||
|
@ -210,6 +212,9 @@ module.exports = React.createClass({
|
||||||
isKnown: true,
|
isKnown: true,
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
performance.mark('end');
|
||||||
|
performance.measure('setopts', 'start', 'middle');
|
||||||
|
performance.measure('search', 'middle', 'end');
|
||||||
|
|
||||||
// If the query is a valid address, add an entry for that
|
// If the query is a valid address, add an entry for that
|
||||||
// This is important, otherwise there's no way to invite
|
// This is important, otherwise there's no way to invite
|
||||||
|
|
|
@ -652,7 +652,7 @@ module.exports = React.createClass({
|
||||||
<RoomSubList list={ self.state.lists['m.favourite'] }
|
<RoomSubList list={ self.state.lists['m.favourite'] }
|
||||||
label="Favourites"
|
label="Favourites"
|
||||||
tagName="m.favourite"
|
tagName="m.favourite"
|
||||||
emptyContent={this._getEmptyContent('m.favourite')}
|
emptyContent={self._getEmptyContent('m.favourite')}
|
||||||
editable={ true }
|
editable={ true }
|
||||||
order="manual"
|
order="manual"
|
||||||
incomingCall={ self.state.incomingCall }
|
incomingCall={ self.state.incomingCall }
|
||||||
|
@ -665,8 +665,8 @@ module.exports = React.createClass({
|
||||||
<RoomSubList list={ self.state.lists['im.vector.fake.direct'] }
|
<RoomSubList list={ self.state.lists['im.vector.fake.direct'] }
|
||||||
label="People"
|
label="People"
|
||||||
tagName="im.vector.fake.direct"
|
tagName="im.vector.fake.direct"
|
||||||
emptyContent={this._getEmptyContent('im.vector.fake.direct')}
|
emptyContent={self._getEmptyContent('im.vector.fake.direct')}
|
||||||
headerItems={this._getHeaderItems('im.vector.fake.direct')}
|
headerItems={self._getHeaderItems('im.vector.fake.direct')}
|
||||||
editable={ true }
|
editable={ true }
|
||||||
order="recent"
|
order="recent"
|
||||||
incomingCall={ self.state.incomingCall }
|
incomingCall={ self.state.incomingCall }
|
||||||
|
@ -681,8 +681,8 @@ module.exports = React.createClass({
|
||||||
label="Rooms"
|
label="Rooms"
|
||||||
tagName="im.vector.fake.recent"
|
tagName="im.vector.fake.recent"
|
||||||
editable={ true }
|
editable={ true }
|
||||||
emptyContent={this._getEmptyContent('im.vector.fake.recent')}
|
emptyContent={self._getEmptyContent('im.vector.fake.recent')}
|
||||||
headerItems={this._getHeaderItems('im.vector.fake.recent')}
|
headerItems={self._getHeaderItems('im.vector.fake.recent')}
|
||||||
order="recent"
|
order="recent"
|
||||||
incomingCall={ self.state.incomingCall }
|
incomingCall={ self.state.incomingCall }
|
||||||
collapsed={ self.props.collapsed }
|
collapsed={ self.props.collapsed }
|
||||||
|
@ -697,7 +697,7 @@ module.exports = React.createClass({
|
||||||
key={ tagName }
|
key={ tagName }
|
||||||
label={ tagName }
|
label={ tagName }
|
||||||
tagName={ tagName }
|
tagName={ tagName }
|
||||||
emptyContent={this._getEmptyContent(tagName)}
|
emptyContent={self._getEmptyContent(tagName)}
|
||||||
editable={ true }
|
editable={ true }
|
||||||
order="manual"
|
order="manual"
|
||||||
incomingCall={ self.state.incomingCall }
|
incomingCall={ self.state.incomingCall }
|
||||||
|
@ -713,7 +713,7 @@ module.exports = React.createClass({
|
||||||
<RoomSubList list={ self.state.lists['m.lowpriority'] }
|
<RoomSubList list={ self.state.lists['m.lowpriority'] }
|
||||||
label="Low priority"
|
label="Low priority"
|
||||||
tagName="m.lowpriority"
|
tagName="m.lowpriority"
|
||||||
emptyContent={this._getEmptyContent('m.lowpriority')}
|
emptyContent={self._getEmptyContent('m.lowpriority')}
|
||||||
editable={ true }
|
editable={ true }
|
||||||
order="recent"
|
order="recent"
|
||||||
incomingCall={ self.state.incomingCall }
|
incomingCall={ self.state.incomingCall }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue