show default displayname in ChangeDisplayName prompt

pull/21833/head
Matthew Hodgson 2016-03-19 02:45:06 +00:00
parent f999aa94e1
commit a44ebddae0
1 changed files with 12 additions and 1 deletions

View File

@ -43,8 +43,19 @@ module.exports = React.createClass({
this.setState({busy: true});
var self = this;
cli.getProfileInfo(cli.credentials.userId).done(function(result) {
var displayname = result.displayname;
if (!displayname) {
if (MatrixClientPeg.get().isGuest()) {
displayname = "Guest " + MatrixClientPeg.get().getUserIdLocalpart();
}
else {
displayname = MatrixClientPeg.get().getUserIdLocalpart();
}
}
self.setState({
displayName: result.displayname,
displayName: displayname,
busy: false
});
}, function(error) {