diff --git a/js/models/conversations.js b/js/models/conversations.js index ad8255f5..2d3ee189 100644 --- a/js/models/conversations.js +++ b/js/models/conversations.js @@ -301,15 +301,15 @@ return textsecure.storage.axolotl.removeIdentityKey(number).then(function() { return textsecure.storage.axolotl.putIdentityKey(number, identityKey).then(function() { - var promise = Promise.resolve(); + var promises = []; this.messageCollection.each(function(message) { if (message.hasKeyConflict(number)) { - promise = promise.then(function() { - return message.resolveConflict(number); - }); + promises.push(new Promise(function(resolve) { + resolve(message.resolveConflict(number)); + })); } }); - return promise; + return promises; }.bind(this)); }.bind(this)); }, diff --git a/js/views/key_conflict_dialogue_view.js b/js/views/key_conflict_dialogue_view.js index 40ad44d5..190c4d34 100644 --- a/js/views/key_conflict_dialogue_view.js +++ b/js/views/key_conflict_dialogue_view.js @@ -28,11 +28,9 @@ } }, resolve: function() { - new Promise(function(resolve) { - this.conversation.resolveConflicts(this.model).then(resolve); - }.bind(this)); this.trigger('resolve'); this.remove(); + this.conversation.resolveConflicts(this.model); }, render: function() { this.$el.html(Mustache.render(this.template, this.model));