Skip to content

Commit

Permalink
Merge pull request #420 from nextcloud/fix/composer-draft-this
Browse files Browse the repository at this point in the history
Fix the 'this' references of composerview closures
  • Loading branch information
ChristophWurst committed Aug 2, 2017
2 parents 79221b8 + f3c35a2 commit 7128a89
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions js/views/composerview.js
Original file line number Diff line number Diff line change
Expand Up @@ -396,9 +396,9 @@ define(function(require) {
// send the mail
var _this = this;
Radio.message.request('draft', this.account, this.getMessage(), {
folder: this.folder,
repliedMessage: this.repliedMessage,
draftUID: this.draftUID
folder: _this.folder,
repliedMessage: _this.repliedMessage,
draftUID: _this.draftUID
}).then(function(data) {
if (_.isFunction(onSuccess)) {
onSuccess();
Expand All @@ -407,7 +407,7 @@ define(function(require) {
if (_this.draftUID !== null) {
// update UID in message list
var collection = Radio.ui.request('messagesview:collection');
var message = collection.findWhere({id: this.draftUID});
var message = collection.findWhere({id: _this.draftUID});
if (message) {
message.set({id: data.uid});
collection.set([message], {remove: false});
Expand Down

0 comments on commit 7128a89

Please sign in to comment.