Fix renew order refresh (#1179)

This commit is contained in:
KoalaSat 2024-03-15 02:18:06 +01:00 committed by GitHub
parent 4741c660c3
commit b8fd2e21cd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 3 deletions

View File

@ -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) {

View File

@ -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(() => {