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
2 changes: 1 addition & 1 deletion extension/chrome/elements/attachment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ export class AttachmentDownloadView extends View {
});
if (decrRes.success && decrRes.content) {
const openpgpType = MsgUtil.type({ data: decrRes.content });
if (openpgpType && openpgpType.type === 'publicKey' && openpgpType.armored) {
if (openpgpType?.type === 'publicKey' && openpgpType.armored) {
// 'openpgpType.armored': could potentially process unarmored pubkey files, maybe later
BrowserMsg.send.renderPublicKeys(this.parentTabId, {
afterFrameId: this.frameId,
Expand Down
2 changes: 1 addition & 1 deletion extension/js/common/api/email-provider/sendable-msg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export class SendableMsg {
): Promise<SendableMsg> => {
const mostUsefulPrv = KeyStoreUtil.chooseMostUseful(await KeyStoreUtil.parse(await KeyStore.getRequired(acctEmail)), 'EVEN-IF-UNUSABLE');
const headers: Dict<string> = {};
if (mostUsefulPrv && mostUsefulPrv.key.family === 'openpgp') {
if (mostUsefulPrv?.key.family === 'openpgp') {
headers.Openpgp = `id=${mostUsefulPrv.key.id}`; // todo - use autocrypt format
}
return new SendableMsg(acctEmail, headers, isDraft === true, from, replyTo, recipients, subject, body || {}, attachments || [], thread, type, externalId);
Expand Down
2 changes: 1 addition & 1 deletion extension/js/common/core/mime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ export class Mime {

private static isNodeInline(node: MimeParserNode): boolean {
const cd = node.headers['content-disposition'];
return cd?.[0] && cd[0].value === 'inline';
return cd?.[0]?.value === 'inline';
}

private static fromEqualSignNotationAsBuf(str: string): Buf {
Expand Down
2 changes: 1 addition & 1 deletion extension/js/common/message-renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ export class MessageRenderer {
data = new Buf(att);
}
const openpgpType = MsgUtil.type({ data });
if (openpgpType && openpgpType.type === 'publicKey' && openpgpType.armored) {
if (openpgpType?.type === 'publicKey' && openpgpType.armored) {
// todo: publicKey attachment can't be too big, so we could do preparePubkey() call (checking file length) right here
treatAs = 'publicKey';
} else if (treatAs === 'publicKey' && openpgpType?.type === 'encryptedMsg') {
Expand Down
2 changes: 1 addition & 1 deletion extension/js/common/platform/store/contact-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ export class ContactStore extends AbstractStore {
resolve(undefined);
return;
}
if (!email.fingerprints || email.fingerprints.length === 0) {
if (email.fingerprints?.length === 0) {
resolve(email);
return;
}
Expand Down
2 changes: 1 addition & 1 deletion extension/js/common/render-relay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class RenderRelay implements RenderInterface {
};

public renderProgress = ({ operationId, percent, loaded, total, expectedTransferSize }: Bm.AjaxProgress) => {
if (this.progressOperation && this.progressOperation.operationId === operationId) {
if (this.progressOperation?.operationId === operationId) {
const perc = Value.getPercentage(percent, loaded, total, expectedTransferSize);
if (typeof perc !== 'undefined') {
this.relay({ progressOperation: { ...this.progressOperation, perc } });
Expand Down
3 changes: 1 addition & 2 deletions extension/js/common/ui/backup-ui/backup-ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,7 @@ export class BackupUi {
private preparePrvKeysBackupSelection = async () => {
const kinfos = await KeyStore.get(this.acctEmail);
if (
this.keyIdentity &&
this.keyIdentity.family === 'openpgp' &&
this.keyIdentity?.family === 'openpgp' &&
kinfos.some(ki => KeyUtil.identityEquals(ki, this.keyIdentity!)) // eslint-disable-line @typescript-eslint/no-non-null-assertion
) {
// todo: error if not found ?
Expand Down
Loading
Loading