Skip to content

Commit

Permalink
fix rendering messageactions
Browse files Browse the repository at this point in the history
  • Loading branch information
ggazzo committed May 6, 2019
1 parent 1682dea commit d7dec15
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/threads/client/flextab/thread.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Template.thread.helpers({
return Threads.find({ tmid }, { sort });
},
messageContext() {
const result = messageContext.apply(this);
const result = messageContext.call(this, { rid: this.mainMessage.rid });
return {
...result,
settings: {
Expand Down
3 changes: 2 additions & 1 deletion app/threads/client/flextab/threads.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Template.threads.events({

Template.threads.helpers({
subscription() {
return Template.instance().data.subscription;
return Template.currentData().subscription;
},
doDotLoadThreads() {
return Template.instance().state.get('close');
Expand Down Expand Up @@ -74,6 +74,7 @@ Template.threads.onCreated(async function() {
thread: msg,
});

this.rid = rid;

this.incLimit = () => {

Expand Down
4 changes: 2 additions & 2 deletions app/ui-utils/client/lib/messageContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import { hasPermission } from '../../../authorization/client';
import { settings } from '../../../settings/client';
import { getUserPreference } from '../../../utils/client';

export function messageContext() {
const { rid } = Template.instance();
export function messageContext({ rid } = Template.instance()) {
const uid = Meteor.userId();
return {
u: Users.findOne({ _id: uid }, { fields: { name: 1, username: 1 } }),
Expand All @@ -22,6 +21,7 @@ export function messageContext() {
fields: {
name: 1,
autoTranslate: 1,
rid: 1,
},
}),
settings: {
Expand Down

0 comments on commit d7dec15

Please sign in to comment.