Skip to content

Commit

Permalink
Regression: Fix clicking on visitor's chat in the sidebar does not di…
Browse files Browse the repository at this point in the history
…splay the chat window (#25380)
  • Loading branch information
Filipe Marins authored May 3, 2022
1 parent 79f05d3 commit 0f7732c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion apps/meteor/app/ui-utils/client/lib/openRoom.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export const openRoom = async function (type, name, render = true) {
// update user's room subscription
const sub = ChatSubscription.findOne({ rid: room._id });
if (sub && sub.open === false) {
callWithErrorHandling('openRoom', room._id);
await callWithErrorHandling('openRoom', room._id);
}

if (FlowRouter.getQueryParam('msg')) {
Expand Down
18 changes: 10 additions & 8 deletions apps/meteor/app/ui/client/views/app/room.js
Original file line number Diff line number Diff line change
Expand Up @@ -934,16 +934,18 @@ Meteor.startup(() => {
}, 500);

this.autorun(() => {
if (rid !== Session.get('openedRoom')) {
return;
}
Tracker.afterFlush(() => {
if (rid !== Session.get('openedRoom')) {
return;
}

let room = Rooms.findOne({ _id: rid }, { fields: { t: 1 } });
let room = Rooms.findOne({ _id: rid }, { fields: { t: 1 } });

if (room?.t === 'l') {
room = Tracker.nonreactive(() => Rooms.findOne({ _id: rid }));
roomCoordinator.getRoomDirectives(room.t)?.openCustomProfileTab(this, room, room.v.username);
}
if (room?.t === 'l') {
room = Tracker.nonreactive(() => Rooms.findOne({ _id: rid }));
roomCoordinator.getRoomDirectives(room.t)?.openCustomProfileTab(this, room, room.v.username);
}
});
});

this.autorun(() => {
Expand Down

0 comments on commit 0f7732c

Please sign in to comment.