Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ export class ComposeRecipientsModule extends ViewModule<ComposeView> {
}, 0);
})();
}
await Promise.all(recipientEls.map(r => r.evaluating));
await Promise.all(recipientEls.map(r => r.evaluating).filter(p => p !== undefined));
if (triggerCallback) {
for (const callback of this.onRecipientAddedCallbacks) {
callback(recipientEls);
Expand Down Expand Up @@ -405,7 +405,7 @@ export class ComposeRecipientsModule extends ViewModule<ComposeView> {
if (this.view.S.cached('input_addresses_container_outer').hasClass('invisible')) {
return;
}
await Promise.all(this.addedRecipients.map(r => r.evaluating)); // Wait until all recipients loaded.
await Promise.all(this.addedRecipients.map(r => r.evaluating).filter(p => p !== undefined)); // Wait until all recipients loaded.
this.showHideCcAndBccInputsIfNeeded();
this.view.S.cached('input_addresses_container_outer').addClass('invisible');
this.view.S.cached('recipients_placeholder').css('display', 'flex');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -476,12 +476,11 @@ export class ComposeRenderModule extends ViewModule<ComposeView> {
};

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

Expand Down
8 changes: 3 additions & 5 deletions extension/js/common/api/email-provider/gmail/gmail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -413,11 +413,9 @@ export class Gmail extends EmailProviderApi implements EmailProviderInterface {
}
}
const rawValidEmails = rawParsedResults.filter(r => r.address && Str.isEmailValid(r.address));
const newValidResults: EmailProviderContact[] = await Promise.all(
rawValidEmails.map(a => {
return { email: a.address!, name: a.name }; // eslint-disable-line @typescript-eslint/no-non-null-assertion
})
);
const newValidResults: EmailProviderContact[] = rawValidEmails.map(a => {
return { email: a.address!, name: a.name }; // eslint-disable-line @typescript-eslint/no-non-null-assertion
});
const uniqueNewValidResults: EmailProviderContact[] = [];
for (const newValidRes of newValidResults) {
if (!allResults.map(c => c.email).includes(newValidRes.email)) {
Expand Down
2 changes: 1 addition & 1 deletion extension/js/common/api/shared/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ export class Api {
}),
};
} else {
return { response, pipe: Value.noop }; // original response
return { response, pipe: async () => { /* no-op */ } }; // original response
}
};

Expand Down
4 changes: 3 additions & 1 deletion extension/js/common/core/crypto/pgp/openpgp-key.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,9 @@ export class OpenPGPKey {
result.set(`Primary key expiration?`, await KeyUtil.formatResultAsync(async () => OpenPGPKey.formatDate(await key.getExpirationTime())));
result.set(`Primary key getBitSize?`, await KeyUtil.formatResultAsync(async () => key.getAlgorithmInfo().bits));
const encryptResult = await OpenPGPKey.testEncryptDecrypt(key);
await Promise.all(encryptResult.map(msg => result.set(`Encrypt/Decrypt test: ${msg}`, '')));
for (const msg of encryptResult) {
result.set(`Encrypt/Decrypt test: ${msg}`, '');
}
if (key.isPrivate()) {
result.set(`Sign/Verify test`, await KeyUtil.formatResultAsync(async () => await OpenPGPKey.testSignVerify(key)));
}
Expand Down
Loading
Loading