mirror of
https://github.com/wekan/wekan.git
synced 2025-12-19 08:50:13 +01:00
Put 'this' in 'self' variable
For some reason, TrelloCreator didn't keep 'this' reference
This commit is contained in:
parent
bc4ea6fd9a
commit
255df20da0
2 changed files with 7 additions and 5 deletions
|
|
@ -318,11 +318,12 @@ export class TrelloCreator {
|
||||||
// - HEAD returns null, which causes exception down the line
|
// - HEAD returns null, which causes exception down the line
|
||||||
// - the template then tries to display the url to the attachment which causes other errors
|
// - the template then tries to display the url to the attachment which causes other errors
|
||||||
// so we make it server only, and let UI catch up once it is done, forget about latency comp.
|
// so we make it server only, and let UI catch up once it is done, forget about latency comp.
|
||||||
|
const self = this;
|
||||||
if(Meteor.isServer) {
|
if(Meteor.isServer) {
|
||||||
file.attachData(att.url, function (error) {
|
file.attachData(att.url, function (error) {
|
||||||
file.boardId = boardId;
|
file.boardId = boardId;
|
||||||
file.cardId = cardId;
|
file.cardId = cardId;
|
||||||
file.userId = this._user(att.idMemberCreator);
|
file.userId = self._user(att.idMemberCreator);
|
||||||
// The field source will only be used to prevent adding
|
// The field source will only be used to prevent adding
|
||||||
// attachments' related activities automatically
|
// attachments' related activities automatically
|
||||||
file.source = 'import';
|
file.source = 'import';
|
||||||
|
|
@ -332,7 +333,7 @@ export class TrelloCreator {
|
||||||
const wekanAtt = Attachments.insert(file, () => {
|
const wekanAtt = Attachments.insert(file, () => {
|
||||||
// we do nothing
|
// we do nothing
|
||||||
});
|
});
|
||||||
this.attachmentIds[att.id] = wekanAtt._id;
|
self.attachmentIds[att.id] = wekanAtt._id;
|
||||||
//
|
//
|
||||||
if(trelloCoverId === att.id) {
|
if(trelloCoverId === att.id) {
|
||||||
Cards.direct.update(cardId, { $set: {coverId: wekanAtt._id}});
|
Cards.direct.update(cardId, { $set: {coverId: wekanAtt._id}});
|
||||||
|
|
|
||||||
|
|
@ -307,12 +307,13 @@ export class WekanCreator {
|
||||||
// - HEAD returns null, which causes exception down the line
|
// - HEAD returns null, which causes exception down the line
|
||||||
// - the template then tries to display the url to the attachment which causes other errors
|
// - the template then tries to display the url to the attachment which causes other errors
|
||||||
// so we make it server only, and let UI catch up once it is done, forget about latency comp.
|
// so we make it server only, and let UI catch up once it is done, forget about latency comp.
|
||||||
|
const self = this;
|
||||||
if(Meteor.isServer) {
|
if(Meteor.isServer) {
|
||||||
if (att.url) {
|
if (att.url) {
|
||||||
file.attachData(att.url, function (error) {
|
file.attachData(att.url, function (error) {
|
||||||
file.boardId = boardId;
|
file.boardId = boardId;
|
||||||
file.cardId = cardId;
|
file.cardId = cardId;
|
||||||
file.userId = this._user(att.userId);
|
file.userId = self._user(att.userId);
|
||||||
// The field source will only be used to prevent adding
|
// The field source will only be used to prevent adding
|
||||||
// attachments' related activities automatically
|
// attachments' related activities automatically
|
||||||
file.source = 'import';
|
file.source = 'import';
|
||||||
|
|
@ -322,7 +323,7 @@ export class WekanCreator {
|
||||||
const wekanAtt = Attachments.insert(file, () => {
|
const wekanAtt = Attachments.insert(file, () => {
|
||||||
// we do nothing
|
// we do nothing
|
||||||
});
|
});
|
||||||
this.attachmentIds[att._id] = wekanAtt._id;
|
self.attachmentIds[att._id] = wekanAtt._id;
|
||||||
//
|
//
|
||||||
if(wekanCoverId === att._id) {
|
if(wekanCoverId === att._id) {
|
||||||
Cards.direct.update(cardId, { $set: {coverId: wekanAtt._id}});
|
Cards.direct.update(cardId, { $set: {coverId: wekanAtt._id}});
|
||||||
|
|
@ -334,7 +335,7 @@ export class WekanCreator {
|
||||||
file.name(att.name);
|
file.name(att.name);
|
||||||
file.boardId = boardId;
|
file.boardId = boardId;
|
||||||
file.cardId = cardId;
|
file.cardId = cardId;
|
||||||
file.userId = this._user(att.userId);
|
file.userId = self._user(att.userId);
|
||||||
// The field source will only be used to prevent adding
|
// The field source will only be used to prevent adding
|
||||||
// attachments' related activities automatically
|
// attachments' related activities automatically
|
||||||
file.source = 'import';
|
file.source = 'import';
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue