mirror of
https://github.com/RoboSats/robosats.git
synced 2025-01-18 12:11:35 +00:00
Fix renew order refresh (#1179)
This commit is contained in:
parent
4741c660c3
commit
b8fd2e21cd
@ -49,10 +49,15 @@ const OrderPage = (): JSX.Element => {
|
||||
setBaseUrl(`${url}${basePath}`);
|
||||
|
||||
const orderId = Number(params.orderId);
|
||||
if (orderId && currentOrderId.id !== orderId && currentOrderId.shortAlias !== shortAlias)
|
||||
if (
|
||||
orderId &&
|
||||
currentOrderId.id !== orderId &&
|
||||
currentOrderId.shortAlias !== shortAlias &&
|
||||
shortAlias
|
||||
)
|
||||
setCurrentOrderId({ id: orderId, shortAlias });
|
||||
if (!acknowledgedWarning) setOpen({ ...closeAll, warning: true });
|
||||
}, [params]);
|
||||
}, [params, currentOrderId]);
|
||||
|
||||
const onClickCoordinator = function (): void {
|
||||
if (currentOrder?.shortAlias != null) {
|
||||
|
@ -118,7 +118,7 @@ interface Contract {
|
||||
const TradeBox = ({ baseUrl, onStartAgain }: TradeBoxProps): JSX.Element => {
|
||||
const { garage, orderUpdatedAt, setBadOrder } = useContext<UseGarageStoreType>(GarageContext);
|
||||
const { settings, hostUrl, origin } = useContext<UseAppStoreType>(AppContext);
|
||||
const { federation } = useContext<UseFederationStoreType>(FederationContext);
|
||||
const { federation, setCurrentOrderId } = useContext<UseFederationStoreType>(FederationContext);
|
||||
const navigate = useNavigate();
|
||||
|
||||
// Buttons and Dialogs
|
||||
@ -186,6 +186,7 @@ const TradeBox = ({ baseUrl, onStartAgain }: TradeBoxProps): JSX.Element => {
|
||||
setBadOrder(data.bad_request);
|
||||
} else if (data.id !== undefined) {
|
||||
navigate(`/order/${String(currentOrder?.shortAlias)}/${String(data.id)}`);
|
||||
setCurrentOrderId({ id: data.id, shortAlias: currentOrder?.shortAlias });
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
|
Loading…
Reference in New Issue
Block a user