simplified rejection for one promise

This commit is contained in:
Abhinav Adduri 2017-07-13 14:47:53 -07:00
parent cec3d6b548
commit e9c49073a8

View file

@ -92,9 +92,7 @@ class FileReceiver extends EventEmitter {
const integrity = new Uint8Array(calculatedHash).toString() === proposedHash.toString(); const integrity = new Uint8Array(calculatedHash).toString() === proposedHash.toString();
if (!integrity) { if (!integrity) {
this.emit('unsafe', true) this.emit('unsafe', true)
return new Promise((resolve, reject) => { return Promise.reject();
reject();
})
} else { } else {
this.emit('safe', true); this.emit('safe', true);
return Promise.all([ return Promise.all([