Skip to content

Commit

Permalink
room info
Browse files Browse the repository at this point in the history
  • Loading branch information
ggazzo committed Mar 24, 2020
1 parent 1bf9f2b commit 4293f38
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/lib/client/defaultTabBars.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ TabBar.addButton({

TabBar.addButton({
groups: ['direct'],
id: 'user-info',
id: 'user-info-group',
i18nTitle: 'Members_List',
icon: 'team',
template: 'membersList',
Expand Down
19 changes: 17 additions & 2 deletions app/ui/client/views/app/room.js
Original file line number Diff line number Diff line change
Expand Up @@ -1019,7 +1019,22 @@ Template.room.onCreated(function() {

this.subscription = new ReactiveVar();
this.state = new ReactiveDict();
this.userDetail = new ReactiveVar(FlowRouter.getParam('username'));
this.userDetail = new ReactiveVar('');
const user = Meteor.user();
this.autorun((c) => {
const room = Rooms.findOne({ _id: rid }, {
fields: {
t: 1,
usernames: 1,
},
});

if (room.t !== 'd') {
return c.stop();
}

this.userDetail.set(room.usernames.filter((username) => username !== user.username));
});

this.autorun(() => {
const rid = Template.currentData()._id;
Expand Down Expand Up @@ -1352,7 +1367,7 @@ Template.room.onRendered(function() {

const room = Rooms.findOne({ _id: template.data._id });
if (!room) {
FlowRouter.go('home');
return FlowRouter.go('home');
}

callbacks.run('onRenderRoom', template, room);
Expand Down

0 comments on commit 4293f38

Please sign in to comment.