diff --git a/src/app/hooks/useMaintenance.ts b/src/app/hooks/useMaintenance.ts index fac2bf444..218d8a16a 100644 --- a/src/app/hooks/useMaintenance.ts +++ b/src/app/hooks/useMaintenance.ts @@ -78,14 +78,14 @@ export function useMaintenance() { ); const checkMaintenances = useCallback((): MaintenanceResult => { - return Object.keys(States).reduce( + return Object.keys(maintenanceStates).reduce( (res, curr) => Object.assign(res, { [curr]: checkMaintenance(curr as States), }), {} as MaintenanceResult, ); - }, [checkMaintenance]); + }, [checkMaintenance, maintenanceStates]); return useMemo(() => ({ checkMaintenance, checkMaintenances, States }), [ checkMaintenance, diff --git a/src/app/pages/MarginTradePage/components/TradeForm/index.tsx b/src/app/pages/MarginTradePage/components/TradeForm/index.tsx index 6746c5016..27c6951bd 100644 --- a/src/app/pages/MarginTradePage/components/TradeForm/index.tsx +++ b/src/app/pages/MarginTradePage/components/TradeForm/index.tsx @@ -210,6 +210,13 @@ export const TradeForm: React.FC = ({ pairType }) => { ], ); + const underMaintenance = useMemo( + () => + openTradesLocked || + (orderType === OrderType.LIMIT && openLimitTradeLocked), + [openTradesLocked, openLimitTradeLocked, orderType], + ); + useEffect(() => { getPriceAmm(pair.shortAsset, pair.longAsset, toWei('0.01')) .then(response => bignumber(response).mul(100)) @@ -381,7 +388,7 @@ export const TradeForm: React.FC = ({ pairType }) => { )} - {!openTradesLocked && ( + {!underMaintenance && ( <> = ({ pairType }) => { )} - {openTradesLocked && ( + {underMaintenance && (