Skip to content

Commit

Permalink
chore(connect): replace abortablePromise with resolveAfter
Browse files Browse the repository at this point in the history
  • Loading branch information
marekrjpolak committed Feb 6, 2025
1 parent 8a46b1c commit 8d35f1d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
7 changes: 2 additions & 5 deletions packages/connect/src/device/DeviceList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
createDeferred,
getSynchronize,
isNotUndefined,
resolveAfter,
} from '@trezor/utils';

import { ERRORS } from '../constants';
Expand All @@ -26,7 +27,6 @@ import { Device } from './Device';
import { getBridgeInfo } from '../data/transportInfo';
import { ConnectSettings, DeviceUniquePath, StaticSessionId } from '../types';
import { typedObjectKeys } from '../types/utils';
import { abortablePromise } from '../utils/abortablePromise';
import { initLog } from '../utils/debug';

const createAuthPenaltyManager = (priority: number) => {
Expand Down Expand Up @@ -396,10 +396,7 @@ export class DeviceList extends TypedEmitter<DeviceListEvents> implements IDevic
}

private createReconnectDelay(signal: AbortSignal) {
const { promise, resolve } = abortablePromise(signal);
const timeout = setTimeout(resolve, 1000);

return promise.finally(() => clearTimeout(timeout));
return resolveAfter(1000, signal);
}

private scheduleUpgradeCheck(apiType: TransportApiType, initParams: InitParams) {
Expand Down
13 changes: 0 additions & 13 deletions packages/connect/src/utils/abortablePromise.ts

This file was deleted.

0 comments on commit 8d35f1d

Please sign in to comment.