Skip to content

Commit

Permalink
chore: global checks switch
Browse files Browse the repository at this point in the history
  • Loading branch information
kyranjamie committed Dec 18, 2024
1 parent d672d99 commit 710c698
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
6 changes: 6 additions & 0 deletions src/app/pages/home/home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { Route, useNavigate } from 'react-router-dom';
import { HomePageSelectors } from '@tests/selectors/home.selectors';
import { Box, Stack } from 'leather-styles/jsx';

import { Switch } from '@leather.io/ui';

import { RouteUrls } from '@shared/route-urls';

import { useAccountDisplayName } from '@app/common/hooks/account/use-account-names';
Expand Down Expand Up @@ -74,6 +76,10 @@ export function Home() {
onShowBalance={togglePrivateMode}
>
<AccountActions />
Globally toggle inscription protection
<Switch.Root onCheckedChange={val => console.log(val)}>

Check failure on line 80 in src/app/pages/home/home.tsx

View workflow job for this annotation

GitHub Actions / lint-eslint

Unexpected console statement
<Switch.Thumb />
</Switch.Root>
</AccountCard>
</Box>
{whenPageMode({ full: <FeedbackButton />, popup: null })}
Expand Down
9 changes: 4 additions & 5 deletions src/app/query/bitcoin/address/utxos-by-address.hooks.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { useNativeSegwitUtxosByAddress } from '@leather.io/query';

import { useCurrentAccountNativeSegwitIndexZeroSigner } from '@app/store/accounts/blockchain/bitcoin/native-segwit-account.hooks';
import { useHasUserBypassedInscriptionChecks } from '@app/store/settings/settings.selectors';

const defaultArgs = {
filterInscriptionUtxos: true,
Expand All @@ -16,15 +15,15 @@ const defaultArgs = {
export function useCurrentNativeSegwitUtxos(args = defaultArgs) {
const { filterInscriptionUtxos, filterPendingTxsUtxos, filterRunesUtxos } = args;

const hasUserByPassedInscriptionChecks = useHasUserBypassedInscriptionChecks();

const nativeSegwitSigner = useCurrentAccountNativeSegwitIndexZeroSigner();
const address = nativeSegwitSigner.address;

return useNativeSegwitUtxosByAddress({
const query = useNativeSegwitUtxosByAddress({
address,
filterInscriptionUtxos: hasUserByPassedInscriptionChecks ? false : filterInscriptionUtxos,
filterInscriptionUtxos,
filterPendingTxsUtxos,
filterRunesUtxos,
});

return { ...query };
}

0 comments on commit 710c698

Please sign in to comment.