Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sosnovsky committed Sep 16, 2024
1 parent 085fd3e commit 26651a4
Show file tree
Hide file tree
Showing 10 changed files with 78 additions and 60 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { EmailParts, Str } from '../../../js/common/core/common.js';
import { AcctStore } from '../../../js/common/platform/store/acct-store.js';

export class ComposeStorageModule extends ViewModule<ComposeView> {
public getAccountKeys = async (senderEmail: string | undefined, family?: 'openpgp' | 'x509' | undefined): Promise<KeyInfoWithIdentity[]> => {
public getAccountKeys = async (senderEmail: string | undefined, family?: 'openpgp' | 'x509'): Promise<KeyInfoWithIdentity[]> => {
const unfilteredKeys = await KeyStore.get(this.view.acctEmail);
Assert.abortAndRenderErrorIfKeyinfoEmpty(unfilteredKeys);
const matchingFamily = unfilteredKeys.filter(ki => !family || ki.family === family);
Expand Down
4 changes: 2 additions & 2 deletions extension/js/common/core/crypto/key.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ export class KeyUtil {
throw new UnexpectedKeyTypeError(`Key type is ${keyType}, expecting OpenPGP or x509 S/MIME`);
}

public static async readBinary(key: Uint8Array, passPhrase?: string | undefined): Promise<{ keys: Key[]; err: Error[] }> {
public static async readBinary(key: Uint8Array, passPhrase?: string): Promise<{ keys: Key[]; err: Error[] }> {
const allKeys: Key[] = [],
allErr: Error[] = [];
let uncheckedOpgpKeyCount = 0;
Expand Down Expand Up @@ -245,7 +245,7 @@ export class KeyUtil {
return { keys: allKeys, err: allErr };
}

public static async parseBinary(key: Uint8Array, passPhrase?: string | undefined): Promise<Key[]> {
public static async parseBinary(key: Uint8Array, passPhrase?: string): Promise<Key[]> {
const { keys, err } = await KeyUtil.readBinary(key, passPhrase);
if (keys.length > 0) {
return keys;
Expand Down
4 changes: 2 additions & 2 deletions extension/js/common/platform/store/contact-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ export class ContactStore extends AbstractStore {
}

// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters
public static setReqPipe<T>(req: IDBRequest, pipe: (value?: T) => void, reject?: ((reason?: unknown) => void) | undefined) {
public static setReqPipe<T>(req: IDBRequest, pipe: (value?: T) => void, reject?: (reason?: unknown) => void) {
req.onsuccess = () => {
try {
pipe(req.result as T);
Expand Down Expand Up @@ -858,7 +858,7 @@ export class ContactStore extends AbstractStore {
});
}

private static chainExtraction<T>(store: IDBObjectStore, setup: { keys: IDBValidKey[]; values: T[] }, req?: IDBRequest | undefined): void {
private static chainExtraction<T>(store: IDBObjectStore, setup: { keys: IDBValidKey[]; values: T[] }, req?: IDBRequest): void {
if (req) {
ContactStore.setReqPipe(req, (value: T) => {
if (value) {
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 @@ -66,7 +66,7 @@ export class RenderRelay implements RenderInterface {
.finally(() => this.relay({ done: true }));
};

public renderErr = (errBoxContent: string, renderRawMsg: string | undefined, errMsg?: string | undefined) => {
public renderErr = (errBoxContent: string, renderRawMsg: string | undefined, errMsg?: string) => {
this.relay({ renderErr: { errBoxContent, renderRawMsg, errMsg } });
};

Expand Down
2 changes: 1 addition & 1 deletion extension/js/common/ui/key-import-ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export class KeyImportUi {

public onBadPassphrase: VoidCallback = () => undefined;

public initPrvImportSrcForm = (acctEmail: string, parentTabId: string | undefined, submitKeyForAddrs?: string[] | undefined) => {
public initPrvImportSrcForm = (acctEmail: string, parentTabId: string | undefined, submitKeyForAddrs?: string[]) => {
$('input[type=radio][name=source]')
.off()
.change(function () {
Expand Down
2 changes: 1 addition & 1 deletion extension/js/service_worker/migrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ export const moveContactsToEmailsAndPubkeys = async (db: IDBDatabase): Promise<v
}
};

const moveContactsBatchToEmailsAndPubkeys = async (db: IDBDatabase, count?: number | undefined): Promise<number> => {
const moveContactsBatchToEmailsAndPubkeys = async (db: IDBDatabase, count?: number): Promise<number> => {
const entries: ContactV3[] = [];
{
const tx = db.transaction(['contacts'], 'readonly');
Expand Down
Loading

0 comments on commit 26651a4

Please sign in to comment.