Fix missing awaits!

pull/430/head
sachaaaaa 6 years ago
parent 6ab05e28df
commit c7dc79e7f9

@ -1094,17 +1094,19 @@ MessageReceiver.prototype.extend({
return true; return true;
}, },
async handlePairingRequest(pairingRequest) { async handlePairingRequest(pairingRequest) {
if (!this.validateAuthorisation(pairingRequest)) { const valid = await this.validateAuthorisation(pairingRequest);
if (!valid) {
return; return;
} }
window.libloki.storage.savePairingAuthorisation(pairingRequest); await window.libloki.storage.savePairingAuthorisation(pairingRequest);
Whisper.events.trigger( Whisper.events.trigger(
'devicePairingRequestReceived', 'devicePairingRequestReceived',
pairingRequest.secondaryDevicePubKey pairingRequest.secondaryDevicePubKey
); );
}, },
async handleAuthorisationForSelf(pairingAuthorisation) { async handleAuthorisationForSelf(pairingAuthorisation) {
if (!this.validateAuthorisation(pairingAuthorisation)) { const valid = await this.validateAuthorisation(pairingAuthorisation);
if (!valid) {
return; return;
} }
const { type, primaryDevicePubKey } = pairingAuthorisation; const { type, primaryDevicePubKey } = pairingAuthorisation;
@ -1132,7 +1134,8 @@ MessageReceiver.prototype.extend({
} }
}, },
async handleAuthorisationForContact(pairingAuthorisation) { async handleAuthorisationForContact(pairingAuthorisation) {
if (!this.validateAuthorisation(pairingAuthorisation)) { const valid = this.validateAuthorisation(pairingAuthorisation);
if (!valid) {
return; return;
} }
const { primaryDevicePubKey, secondaryDevicePubKey } = pairingAuthorisation; const { primaryDevicePubKey, secondaryDevicePubKey } = pairingAuthorisation;

Loading…
Cancel
Save