Skip to content

Commit 48af27a

Browse files
committed
fix: styles for inscription options
1 parent fbb2fed commit 48af27a

File tree

4 files changed

+20
-6
lines changed

4 files changed

+20
-6
lines changed

src/app/features/collectibles/components/bitcoin/inscription.tsx

+7-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,13 @@ export function Inscription({ inscription }: InscriptionProps) {
123123
<Box position="relative" {...bind}>
124124
<Box opacity={hasInscriptionBeenDiscarded(inscription) ? 0.5 : 1}>{content}</Box>
125125
{isHovered && (
126-
<Box bg="ink.background-primary" right="space.03" top="space.03" zIndex="90">
126+
<Box
127+
bg="ink.background-primary"
128+
position="absolute"
129+
right="space.03"
130+
top="space.03"
131+
zIndex="90"
132+
>
127133
<DropdownMenu.Root>
128134
<DropdownMenu.Trigger>
129135
<IconButton

src/app/query/bitcoin/ordinals/inscriptions/inscriptions.query.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
useGetTaprootUtxosByAddressQuery,
1515
utxosToBalance,
1616
} from '@leather.io/query';
17+
import { isString } from '@leather.io/utils';
1718

1819
import { useCurrentAccountIndex } from '@app/store/accounts/account';
1920
import {
@@ -33,6 +34,7 @@ export function useInscriptions({ xpubs }: UseInscriptionArgs) {
3334

3435
export function useNumberOfInscriptionsOnUtxo() {
3536
const xpubs = useCurrentBitcoinAccountXpubs();
37+
3638
const inscriptionQueries = useInscriptions({ xpubs });
3739

3840
// Unsafe as implementation doesn't wait for all results to be successful,
@@ -47,7 +49,8 @@ export function useCurrentNativeSegwitInscriptions() {
4749
const client = useBitcoinClient();
4850
const nativeSegwitXpub = useCurrentBitcoinAccountNativeSegwitXpub();
4951
return useQuery({
50-
...createInscriptionByXpubQuery(client, nativeSegwitXpub),
52+
...createInscriptionByXpubQuery(client, nativeSegwitXpub ?? ''),
53+
enabled: isString(nativeSegwitXpub),
5154
select(data) {
5255
return data.data.map(createBestInSlotInscription);
5356
},

src/app/store/accounts/blockchain/bitcoin/bitcoin.hooks.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
import { extractAddressIndexFromPath } from '@leather.io/crypto';
1414
import { bitcoinNetworkToNetworkMode } from '@leather.io/models';
1515
import { PaymentTypes } from '@leather.io/rpc';
16-
import { isNumber, isUndefined } from '@leather.io/utils';
16+
import { isNumber, isString, isUndefined } from '@leather.io/utils';
1717

1818
import {
1919
BitcoinInputSigningConfig,
@@ -289,17 +289,19 @@ export function useSignBitcoinTx() {
289289

290290
export function useCurrentBitcoinAccountNativeSegwitXpub() {
291291
const nativeSegwitAccount = useCurrentNativeSegwitAccount();
292+
if (!nativeSegwitAccount) return null;
292293
return `wpkh(${nativeSegwitAccount?.keychain.publicExtendedKey})`;
293294
}
294295

295296
function useCurrentBitcoinAccountTaprootXpub() {
296297
const taprootAccount = useCurrentTaprootAccount();
298+
if (!taprootAccount) return null;
297299
return `tr(${taprootAccount?.keychain.publicExtendedKey})`;
298300
}
299301

300302
export function useCurrentBitcoinAccountXpubs() {
301303
const taprootXpub = useCurrentBitcoinAccountTaprootXpub();
302304
const nativeSegwitXpub = useCurrentBitcoinAccountNativeSegwitXpub();
303-
304-
return [taprootXpub, nativeSegwitXpub];
305+
// Not sure why this type cast is necessary, but thinks its string | null without
306+
return [taprootXpub, nativeSegwitXpub].filter(xpub => isString(xpub)) as string[];
305307
}

tests/specs/ledger/ledger.spec.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,10 @@ test.describe('App with Ledger', () => {
5050

5151
await homePage.page.getByTestId(SettingsSelectors.CurrentAccountDisplayName).click();
5252

53-
test.expect(async () => await test.expect(requestPromise).rejects.toThrowError());
53+
await test
54+
.expect(async () => await test.expect(requestPromise).rejects.toThrowError())
55+
.toPass()
56+
.catch();
5457
});
5558
}
5659

0 commit comments

Comments
 (0)