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] Open room after guest registration #18755

Merged
merged 3 commits into from
Sep 18, 2020
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
2 changes: 1 addition & 1 deletion app/ui-message/client/message.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ Template.message.helpers({
return msg.alias || (settings.UI_Use_Real_Name && msg.u && msg.u.name);
},
own() {
const { msg, u } = this;
const { msg, u = {} } = this;
if (msg.u && msg.u._id === u._id) {
return 'own';
}
Expand Down
2 changes: 2 additions & 0 deletions app/ui-utils/client/lib/RoomManager.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Meteor } from 'meteor/meteor';
import { ReactiveVar } from 'meteor/reactive-var';
import { Session } from 'meteor/session';
import { Tracker } from 'meteor/tracker';
import { Blaze } from 'meteor/blaze';
import { FlowRouter } from 'meteor/kadira:flow-router';
Expand Down Expand Up @@ -177,6 +178,7 @@ export const RoomManager = new function() {
const openedRoom = openedRooms[key];
this.close(openedRoom.typeName);
});
Session.set('openedRoom');
}


Expand Down
2 changes: 1 addition & 1 deletion app/ui-utils/client/lib/messageContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const fields = { name: 1, username: 1, 'settings.preferences.showMessageInMainTh

export function messageContext({ rid } = Template.instance()) {
const uid = Meteor.userId();
const user = Users.findOne({ _id: uid }, { fields });
const user = Users.findOne({ _id: uid }, { fields }) || {};
return {
u: user,
room: Rooms.findOne({ _id: rid }, {
Expand Down