Skip to content

Commit

Permalink
chore: code improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
abdulhaseeb4239 committed Dec 15, 2023
1 parent 2195750 commit 152e5c1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/app/hooks/queries/useConfirmedBtcBalance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const useConfirmBtcBalance = () => {

const fetchBtcAddressData = async () => btcClient.getAddressData(btcAddress);

let confirmedBalance: number = 0;
let confirmedBalance = 0;

const response = useQuery({
queryKey: ['btc-address-data'],
Expand Down
8 changes: 6 additions & 2 deletions src/app/screens/createInscription/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ const ButtonImage = styled.img((props) => ({
}));

const DEFAULT_FEE_RATE = 8;
const MAX_REPEATS = 24;

function CreateInscription() {
const { t } = useTranslation('translation', { keyPrefix: 'INSCRIPTION_REQUEST' });
Expand Down Expand Up @@ -263,7 +264,7 @@ function CreateInscription() {
} = payload as CreateInscriptionPayload | CreateRepeatInscriptionsPayload;

const { repeat } = payload as CreateRepeatInscriptionsPayload;
const showOver24RepeatsError = !Number.isNaN(repeat) && repeat > 24;
const showOver24RepeatsError = !Number.isNaN(repeat) && repeat > MAX_REPEATS;

const [utxos, setUtxos] = useState<UTXO[] | undefined>();
const [showFeeSettings, setShowFeeSettings] = useState(false);
Expand Down Expand Up @@ -468,7 +469,10 @@ function CreateInscription() {
<Title>{t('TITLE')}</Title>
<SubTitle>{t('SUBTITLE', { name: appName ?? '' })}</SubTitle>
{showOver24RepeatsError && (
<StyledCallout variant="danger" bodyText={t('ERRORS.TOO_MANY_REPEATS')} />
<StyledCallout
variant="danger"
bodyText={t('ERRORS.TOO_MANY_REPEATS', { maxRepeats: MAX_REPEATS })}
/>
)}
{showConfirmedBalanceError && (
<StyledCallout variant="danger" bodyText={t('ERRORS.UNCONFIRMED_UTXO')} />
Expand Down
2 changes: 1 addition & 1 deletion src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,7 @@
"FAILED_TO_FINALIZE": "The inscription transaction failed to finalize. Please try again or contact support.",
"SERVER_ERROR": "An unknown server error occurred. Please try again or contact support."
},
"TOO_MANY_REPEATS": "You can only create up to 24 inscriptions in a single request",
"TOO_MANY_REPEATS": "You can only create up to {{maxRepeats}} inscriptions in a single request",
"UNCONFIRMED_UTXO": "Some of your balance consists of unconfirmed outputs. You don't have enough confirmed funds to proceed with this transaction",
"LEDGER_INSCRIPTION": "This inscription service is not compatible with Ledger accounts. Please switch to a standard account to inscribe."
}
Expand Down

0 comments on commit 152e5c1

Please sign in to comment.