Skip to content

Commit

Permalink
Fix renew order refresh (#1179)
Browse files Browse the repository at this point in the history
  • Loading branch information
KoalaSat authored Mar 15, 2024
1 parent 4741c66 commit b8fd2e2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
9 changes: 7 additions & 2 deletions frontend/src/basic/OrderPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/components/TradeBox/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(() => {
Expand Down

0 comments on commit b8fd2e2

Please sign in to comment.