Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Show real name of current user at top of side nav if setting enabled #8718

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion packages/rocketchat-ui-sidenav/client/accountBox.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
{{> avatar username=username}}
</div>
<div class="sidebar__account-data">
<h3 class="sidebar__account-username" data-username="{{username}}">@{{username}}</h3>
{{#if fname}}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should use a helper here instead an if and the same html.. what do you think @geekgonecrazy ?

<h3 class="sidebar__account-username" data-username="{{username}}">{{fname}}</h3>
{{else}}
<h3 class="sidebar__account-username" data-username="{{username}}">@{{username}}</h3>
{{/if}}
<div class="sidebar__account-status">
<div class="sidebar__account-status-bullet sidebar__account-status-bullet--{{bullet}}" title="{{visualStatus}}"></div>
<div class="sidebar__account-visual-status">{{visualStatus}}</div>
Expand Down
4 changes: 2 additions & 2 deletions packages/rocketchat-ui-sidenav/client/accountBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Template.accountBox.helpers({
if (Meteor.user() == null && RocketChat.settings.get('Accounts_AllowAnonymousRead')) {
return {
name: t('Anonymous'),
fname: t('Anonymous'),
fname: RocketChat.settings.get('UI_Use_Real_Name') && t('Anonymous'),
status: 'online',
visualStatus: t('online'),
bullet: 'general-success-background',
Expand All @@ -24,7 +24,7 @@ Template.accountBox.helpers({
bullet: userStatus,
_id: Meteor.userId(),
username,
fname: name || username
fname: RocketChat.settings.get('UI_Use_Real_Name') && name
};
},

Expand Down