simplified rejection for one promise
This commit is contained in:
parent
cec3d6b548
commit
e9c49073a8
|
@ -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([
|
||||||
|
|
Loading…
Reference in New Issue