Skip to content

Commit

Permalink
fix: send ordinal routes, closes #4444
Browse files Browse the repository at this point in the history
  • Loading branch information
pete-watters committed Oct 27, 2023
1 parent 433216f commit fd96bb3
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,12 @@ export function useSendInscriptionForm() {

whenWallet({
software: () =>
navigate(RouteUrls.SendOrdinalInscriptionChooseFee, {
state: { inscription, recipient: values.recipient, utxo },
}),
navigate(
`/${RouteUrls.SendOrdinalInscription}/${RouteUrls.SendOrdinalInscriptionChooseFee}`,
{
state: { inscription, recipient: values.recipient, utxo },
}
),
ledger: noop,
})();
},
Expand All @@ -100,17 +103,20 @@ export function useSendInscriptionForm() {

const { hex } = resp;
const feeRowValue = formFeeRowValue(values.feeRate, isCustomFee);
return navigate(RouteUrls.SendOrdinalInscriptionReview, {
state: {
fee: feeValue,
inscription,
utxo,
recipient: values.recipient,
time,
feeRowValue,
tx: hex,
},
});
return navigate(
`/${RouteUrls.SendOrdinalInscription}/${RouteUrls.SendOrdinalInscriptionReview}`,
{
state: {
fee: feeValue,
inscription,
utxo,
recipient: values.recipient,
time,
feeRowValue,
tx: hex,
},
}
);
},

validationSchema: yup.object({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export function SendInscriptionReview() {
await refetch();
// Might be a BRC-20 transfer, so we want to remove it from the pending
dispatch(inscriptionSent({ inscriptionId: inscription.id }));
navigate(RouteUrls.SendOrdinalInscriptionSent, {
navigate(`/${RouteUrls.SendOrdinalInscription}/${RouteUrls.SendOrdinalInscriptionSent}`, {
state: {
inscription,
recipient,
Expand All @@ -58,7 +58,7 @@ export function SendInscriptionReview() {
});
},
onError() {
navigate(RouteUrls.SendOrdinalInscriptionError);
navigate(`/${RouteUrls.SendOrdinalInscription}/${RouteUrls.SendOrdinalInscriptionError}`);
},
});
}
Expand Down
8 changes: 4 additions & 4 deletions src/shared/route-urls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ export enum RouteUrls {

// Send ordinal inscriptions
SendOrdinalInscription = 'send/ordinal-inscription',
SendOrdinalInscriptionChooseFee = 'send/ordinal-inscription/choose-fee',
SendOrdinalInscriptionReview = 'send/ordinal-inscription/review',
SendOrdinalInscriptionChooseFee = 'choose-fee',
SendOrdinalInscriptionReview = 'review',
SendOrdinalInscriptionSummary = 'send/ordinal-inscription/',
SendOrdinalInscriptionSent = 'send/ordinal-inscription/sent',
SendOrdinalInscriptionError = 'send/ordinal-inscription/error',
SendOrdinalInscriptionSent = 'sent',
SendOrdinalInscriptionError = 'error',

// Swap routes
Swap = '/swap',
Expand Down

0 comments on commit fd96bb3

Please sign in to comment.