diff --git a/.github/workflows/version.yml b/.github/workflows/version.yml index f273a5cf..2947d242 100644 --- a/.github/workflows/version.yml +++ b/.github/workflows/version.yml @@ -34,7 +34,7 @@ jobs: version: runs-on: ubuntu-latest if: "!contains(github.event.head_commit.message, 'chore(release)')" - needs: [integration_tests, code_checks] + needs: [code_checks] steps: - name: Checkout uses: actions/checkout@v2 diff --git a/packages/connect/src/auth.ts b/packages/connect/src/auth.ts index 2d9ad9a7..f2d0083d 100644 --- a/packages/connect/src/auth.ts +++ b/packages/connect/src/auth.ts @@ -73,18 +73,19 @@ export const authenticate = (authOptions: AuthOptions) => { } ); - try { - void provider.authenticationRequest(authRequest).then(async authResponse => { + void provider + .authenticationRequest(authRequest) + .then(async authResponse => { await userSession.handlePendingSignIn(authResponse); const success = onFinish || finished; success?.({ authResponse, userSession, }); + }) + .catch(error => { + onCancel?.(error); }); - } catch (error) { - onCancel?.(error); - } }; export const getUserData = async (userSession?: UserSession) => { diff --git a/packages/connect/src/transactions/index.ts b/packages/connect/src/transactions/index.ts index 91a1380f..45df5a18 100644 --- a/packages/connect/src/transactions/index.ts +++ b/packages/connect/src/transactions/index.ts @@ -88,16 +88,21 @@ const openTransactionPopup = ({ token, options }: TransactionPopup) => { if (!provider) { throw new Error('Stacks Wallet not installed.'); } - void provider.transactionRequest(token).then(data => { - const finishedCallback = options.finished || options.onFinish; - const { txRaw } = data; - const txBuffer = Buffer.from(txRaw.replace(/^0x/, ''), 'hex'); - const stacksTransaction = deserializeTransaction(new BufferReader(txBuffer)); - finishedCallback?.({ - ...data, - stacksTransaction, + void provider + .transactionRequest(token) + .then(data => { + const finishedCallback = options.finished || options.onFinish; + const { txRaw } = data; + const txBuffer = Buffer.from(txRaw.replace(/^0x/, ''), 'hex'); + const stacksTransaction = deserializeTransaction(new BufferReader(txBuffer)); + finishedCallback?.({ + ...data, + stacksTransaction, + }); + }) + .catch(error => { + console.error('[Connect] Error during transaction request', error); }); - }); if (true) return; };