Skip to content

Commit

Permalink
fix(signPsbt): window not closing
Browse files Browse the repository at this point in the history
  • Loading branch information
kyranjamie committed Jan 29, 2025
1 parent bdde723 commit 2cb31a7
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 13 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,6 @@
},
"devDependencies": {
"@actions/core": "1.10.1",
"@btckit/types": "0.0.19",
"@chromatic-com/storybook": "3.2.2",
"@leather.io/eslint-config": "0.7.0",
"@leather.io/panda-preset": "0.8.0",
Expand Down
8 changes: 0 additions & 8 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/app/pages/rpc-sign-psbt/use-rpc-sign-psbt.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { useNavigate } from 'react-router-dom';

import { RpcErrorCode } from '@btckit/types';
import { hexToBytes } from '@noble/hashes/utils';
import { bytesToHex } from '@stacks/common';

Expand All @@ -10,6 +9,7 @@ import {
useCalculateBitcoinFiatValue,
useCryptoCurrencyMarketDataMeanAverage,
} from '@leather.io/query';
import { RpcErrorCode } from '@leather.io/rpc';
import {
formatMoney,
formatMoneyPadded,
Expand Down Expand Up @@ -132,6 +132,7 @@ export function useRpcSignPsbt() {
tabId,
makeRpcSuccessResponse('signPsbt', { id: requestId, result: { hex: bytesToHex(psbt) } })
);
closeWindow();
return;
}

Expand Down Expand Up @@ -159,7 +160,6 @@ export function useRpcSignPsbt() {

return;
}
closeWindow();
} catch (e) {
return navigate(RouteUrls.RequestError, {
state: { message: isError(e) ? e.message : '', title: 'Failed to sign' },
Expand Down
2 changes: 1 addition & 1 deletion src/inpage/inpage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,6 @@ try {
}

// Legacy product provider objects
if (typeof window.btc === 'undefined') {
if (typeof (window as any).btc === 'undefined') {
(window as any).btc = warnAboutDeprecatedProvider(provider);
}
1 change: 0 additions & 1 deletion test-app/src/components/debugger.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { useState } from 'react';

import '@btckit/types';
import { demoTokenContract } from '@common/contracts';
import { useSTXAddress } from '@common/use-stx-address';
import {
Expand Down

0 comments on commit 2cb31a7

Please sign in to comment.