Skip to content

Commit

Permalink
Fix anonymous with sidebar extended as default
Browse files Browse the repository at this point in the history
Co-authored-by: ubergeekzone
  • Loading branch information
sampaiodiego committed Jun 18, 2019
1 parent 8da22bf commit 176512e
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions app/ui-sidenav/client/sidebarItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ Template.sidebarItem.onCreated(function() {
this.lastMessageTs = new ReactiveVar();
this.timeAgoInterval;

// console.log('sidebarItem.onCreated');

this.autorun(() => {
const currentData = Template.currentData();

Expand All @@ -98,7 +96,7 @@ Template.sidebarItem.onCreated(function() {

const otherUser = settings.get('UI_Use_Real_Name') ? currentData.lastMessage.u.name || currentData.lastMessage.u.username : currentData.lastMessage.u.username;
const renderedMessage = renderMessageBody(currentData.lastMessage).replace(/<br\s?\\?>/g, ' ');
const sender = this.user._id === currentData.lastMessage.u._id ? t('You') : otherUser;
const sender = this.user && this.user._id === currentData.lastMessage.u._id ? t('You') : otherUser;

if (currentData.t === 'd' && Meteor.userId() !== currentData.lastMessage.u._id) {
this.renderedMessage = currentData.lastMessage.msg === '' ? t('Sent_an_attachment') : renderedMessage;
Expand Down

0 comments on commit 176512e

Please sign in to comment.