[FIX] Messages on thread panel were receiving wrong context/subscription (#14404)

pull/14381/head^2
Guilherme Gazzo 7 years ago committed by GitHub
parent 7b463afdc7
commit aad74afece
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      app/threads/client/flextab/thread.js
  2. 3
      app/threads/client/flextab/threads.js
  3. 4
      app/ui-utils/client/lib/messageContext.js

@ -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: {

@ -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');
@ -74,6 +74,7 @@ Template.threads.onCreated(async function() {
thread: msg,
});
this.rid = rid;
this.incLimit = () => {

@ -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 } }),
@ -22,6 +21,7 @@ export function messageContext() {
fields: {
name: 1,
autoTranslate: 1,
rid: 1,
},
}),
settings: {

Loading…
Cancel
Save