Skip to content

Commit

Permalink
fix(sdk): ensure closure of previously opened gateway
Browse files Browse the repository at this point in the history
  • Loading branch information
thekiba committed Apr 12, 2024
1 parent fa18cb2 commit d4d1d50
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions packages/sdk/src/provider/bridge/bridge-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ export class BridgeProvider implements HTTPProvider {
: ''
};

// TODO: нужно дожидаться одной попытки открыть коннект
return await this.openGateways(storedConnection.sessionCrypto, {
openingDeadlineMS: openingDeadlineMS,
signal: abortController?.signal
Expand All @@ -170,11 +169,9 @@ export class BridgeProvider implements HTTPProvider {

this.session = storedConnection.session;

// TODO: Remove debuggers after testing
if (this.gateway) {
debugger;
// throw new TonConnectError('Gateway is already opened');
console.warn('Gateway is already opened');
logDebug('Gateway is already opened, closing previous gateway');
await this.gateway.close();
}

this.gateway = new BridgeGateway(
Expand Down

0 comments on commit d4d1d50

Please sign in to comment.