Hide 'Email: ' is the first char is @

This commit is contained in:
Kegan Dougal 2016-01-22 17:28:23 +00:00
parent c3f786cc5e
commit e78c1fba87

View file

@ -312,11 +312,18 @@ module.exports = React.createClass({
onSearchQueryChanged: function(input) {
var EntityTile = sdk.getComponent("rooms.EntityTile");
var label;
if (input[0] === "@") {
label = input;
}
else {
label = "Email: " + input;
}
this._emailEntity = new Entities.newEntity(
<EntityTile key="inv_email" suppressOnHover={true} showInviteButton={true}
presenceState="online" onClick={this.onInvite.bind(this, input)} name={
`Email: ${input}`
} />,
<EntityTile key="dynamic_invite_tile" suppressOnHover={true} showInviteButton={true}
presenceState="online" onClick={this.onInvite.bind(this, input)} name={label} />,
function(query) {
return true; // always show this
}