diff --git a/js/libtextsecure.js b/js/libtextsecure.js index bbf65db7..a701f75d 100644 --- a/js/libtextsecure.js +++ b/js/libtextsecure.js @@ -40074,7 +40074,7 @@ window.textsecure.messaging = function() { return textsecure.storage.groups.getNumbers(groupId).then(function(numbers) { if (numbers === undefined) - return new Promise(function(resolve, reject) { reject(new Error("Unknown Group")); }); + return Promise.reject(new Error("Unknown Group")); var promises = []; for (var i in attachments) @@ -40123,7 +40123,7 @@ window.textsecure.messaging = function() { return textsecure.storage.groups.addNumbers(groupId, numbers).then(function(numbers) { if (numbers === undefined) { - return new Promise(function(resolve, reject) { reject(new Error("Unknown Group")); }); + return Promise.reject(new Error("Unknown Group")); } proto.group.members = numbers; @@ -40150,7 +40150,7 @@ window.textsecure.messaging = function() { return textsecure.storage.groups.addNumbers(groupId, [number]).then(function(numbers) { if (numbers === undefined) - return new Promise(function(resolve, reject) { reject(new Error("Unknown Group")); }); + return Promise.reject(new Error("Unknown Group")); proto.group.members = numbers; return sendGroupProto(numbers, proto); @@ -40166,7 +40166,7 @@ window.textsecure.messaging = function() { return textsecure.storage.groups.getNumbers(groupId).then(function(numbers) { if (numbers === undefined) - return new Promise(function(resolve, reject) { reject(new Error("Unknown Group")); }); + return Promise.reject(new Error("Unknown Group")); proto.group.members = numbers; return sendGroupProto(numbers, proto); @@ -40181,7 +40181,7 @@ window.textsecure.messaging = function() { return textsecure.storage.groups.getNumbers(groupId).then(function(numbers) { if (numbers === undefined) - return new Promise(function(resolve, reject) { reject(new Error("Unknown Group")); }); + return Promise.reject(new Error("Unknown Group")); proto.group.members = numbers; return makeAttachmentPointer(avatar).then(function(attachment) { @@ -40199,7 +40199,7 @@ window.textsecure.messaging = function() { return textsecure.storage.groups.getNumbers(groupId).then(function(numbers) { if (numbers === undefined) - return new Promise(function(resolve, reject) { reject(new Error("Unknown Group")); }); + return Promise.reject(new Error("Unknown Group")); return textsecure.storage.groups.deleteGroup(groupId).then(function() { return sendGroupProto(numbers, proto); }); diff --git a/libtextsecure/sendmessage.js b/libtextsecure/sendmessage.js index 489a5cba..2459a983 100644 --- a/libtextsecure/sendmessage.js +++ b/libtextsecure/sendmessage.js @@ -379,7 +379,7 @@ window.textsecure.messaging = function() { return textsecure.storage.groups.getNumbers(groupId).then(function(numbers) { if (numbers === undefined) - return new Promise(function(resolve, reject) { reject(new Error("Unknown Group")); }); + return Promise.reject(new Error("Unknown Group")); var promises = []; for (var i in attachments) @@ -428,7 +428,7 @@ window.textsecure.messaging = function() { return textsecure.storage.groups.addNumbers(groupId, numbers).then(function(numbers) { if (numbers === undefined) { - return new Promise(function(resolve, reject) { reject(new Error("Unknown Group")); }); + return Promise.reject(new Error("Unknown Group")); } proto.group.members = numbers; @@ -455,7 +455,7 @@ window.textsecure.messaging = function() { return textsecure.storage.groups.addNumbers(groupId, [number]).then(function(numbers) { if (numbers === undefined) - return new Promise(function(resolve, reject) { reject(new Error("Unknown Group")); }); + return Promise.reject(new Error("Unknown Group")); proto.group.members = numbers; return sendGroupProto(numbers, proto); @@ -471,7 +471,7 @@ window.textsecure.messaging = function() { return textsecure.storage.groups.getNumbers(groupId).then(function(numbers) { if (numbers === undefined) - return new Promise(function(resolve, reject) { reject(new Error("Unknown Group")); }); + return Promise.reject(new Error("Unknown Group")); proto.group.members = numbers; return sendGroupProto(numbers, proto); @@ -486,7 +486,7 @@ window.textsecure.messaging = function() { return textsecure.storage.groups.getNumbers(groupId).then(function(numbers) { if (numbers === undefined) - return new Promise(function(resolve, reject) { reject(new Error("Unknown Group")); }); + return Promise.reject(new Error("Unknown Group")); proto.group.members = numbers; return makeAttachmentPointer(avatar).then(function(attachment) { @@ -504,7 +504,7 @@ window.textsecure.messaging = function() { return textsecure.storage.groups.getNumbers(groupId).then(function(numbers) { if (numbers === undefined) - return new Promise(function(resolve, reject) { reject(new Error("Unknown Group")); }); + return Promise.reject(new Error("Unknown Group")); return textsecure.storage.groups.deleteGroup(groupId).then(function() { return sendGroupProto(numbers, proto); });