Skip to content

Commit

Permalink
feat(model): fix toString() on User
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Reed committed Feb 22, 2019
1 parent 48e7d48 commit 9ad9a47
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/model/User.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ export class User {
}

public toString() {
return '@' + this.username + (Util.isEmpty(this.display_name) ? '' : ' (' + this.display_name + ')');
let ret = '@' + this.username;
if (!Util.isEmpty(this.display_name) && this.display_name !== this.username) {
ret += ' (' + this.display_name + ')';
}
return ret;
}
}

0 comments on commit 9ad9a47

Please sign in to comment.