Skip to content

Commit b743d66

Browse files
Merge branch 'master' into 6087-support-for-password-protected-pdfs
2 parents e7bf4c2 + 4324b89 commit b743d66

File tree

8 files changed

+481
-393
lines changed

8 files changed

+481
-393
lines changed

extension/chrome/elements/compose-modules/compose-recipients-module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ export class ComposeRecipientsModule extends ViewModule<ComposeView> {
313313
}, 0);
314314
})();
315315
}
316-
await Promise.all(recipientEls.map(r => r.evaluating));
316+
await Promise.all(recipientEls.map(r => r.evaluating).filter(p => p !== undefined));
317317
if (triggerCallback) {
318318
for (const callback of this.onRecipientAddedCallbacks) {
319319
callback(recipientEls);
@@ -405,7 +405,7 @@ export class ComposeRecipientsModule extends ViewModule<ComposeView> {
405405
if (this.view.S.cached('input_addresses_container_outer').hasClass('invisible')) {
406406
return;
407407
}
408-
await Promise.all(this.addedRecipients.map(r => r.evaluating)); // Wait until all recipients loaded.
408+
await Promise.all(this.addedRecipients.map(r => r.evaluating).filter(p => p !== undefined)); // Wait until all recipients loaded.
409409
this.showHideCcAndBccInputsIfNeeded();
410410
this.view.S.cached('input_addresses_container_outer').addClass('invisible');
411411
this.view.S.cached('recipients_placeholder').css('display', 'flex');

extension/chrome/elements/compose-modules/compose-render-module.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -476,12 +476,11 @@ export class ComposeRenderModule extends ViewModule<ComposeView> {
476476
};
477477

478478
private loadRecipientsThenSetTestStateReady = async () => {
479-
await Promise.all(
480-
this.view.recipientsModule
481-
.getRecipients()
482-
.filter(r => r.evaluating)
483-
.map(r => r.evaluating)
484-
);
479+
const evaluatingPromises = this.view.recipientsModule
480+
.getRecipients()
481+
.map(r => r.evaluating)
482+
.filter(r => !!r);
483+
await Promise.all(evaluatingPromises);
485484
document.querySelector('body')?.setAttribute('data-test-state', 'ready'); // set as ready so that automated tests can evaluate results
486485
};
487486

extension/js/common/api/email-provider/gmail/gmail.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -413,11 +413,9 @@ export class Gmail extends EmailProviderApi implements EmailProviderInterface {
413413
}
414414
}
415415
const rawValidEmails = rawParsedResults.filter(r => r.address && Str.isEmailValid(r.address));
416-
const newValidResults: EmailProviderContact[] = await Promise.all(
417-
rawValidEmails.map(a => {
418-
return { email: a.address!, name: a.name }; // eslint-disable-line @typescript-eslint/no-non-null-assertion
419-
})
420-
);
416+
const newValidResults: EmailProviderContact[] = rawValidEmails.map(a => {
417+
return { email: a.address!, name: a.name }; // eslint-disable-line @typescript-eslint/no-non-null-assertion
418+
});
421419
const uniqueNewValidResults: EmailProviderContact[] = [];
422420
for (const newValidRes of newValidResults) {
423421
if (!allResults.map(c => c.email).includes(newValidRes.email)) {

extension/js/common/api/shared/api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ export class Api {
252252
}),
253253
};
254254
} else {
255-
return { response, pipe: Value.noop }; // original response
255+
return { response, pipe: async () => { /* no-op */ } }; // original response
256256
}
257257
};
258258

extension/js/common/core/crypto/pgp/openpgp-key.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,9 @@ export class OpenPGPKey {
350350
result.set(`Primary key expiration?`, await KeyUtil.formatResultAsync(async () => OpenPGPKey.formatDate(await key.getExpirationTime())));
351351
result.set(`Primary key getBitSize?`, await KeyUtil.formatResultAsync(async () => key.getAlgorithmInfo().bits));
352352
const encryptResult = await OpenPGPKey.testEncryptDecrypt(key);
353-
await Promise.all(encryptResult.map(msg => result.set(`Encrypt/Decrypt test: ${msg}`, '')));
353+
for (const msg of encryptResult) {
354+
result.set(`Encrypt/Decrypt test: ${msg}`, '');
355+
}
354356
if (key.isPrivate()) {
355357
result.set(`Sign/Verify test`, await KeyUtil.formatResultAsync(async () => await OpenPGPKey.testSignVerify(key)));
356358
}

0 commit comments

Comments
 (0)