diff --git a/src/views/forms/TradeForm/AdvancedTradeOptions.tsx b/src/views/forms/TradeForm/AdvancedTradeOptions.tsx index a1e1842..40a5282 100644 --- a/src/views/forms/TradeForm/AdvancedTradeOptions.tsx +++ b/src/views/forms/TradeForm/AdvancedTradeOptions.tsx @@ -29,7 +29,7 @@ export const AdvancedTradeOptions = () => { const currentTradeFormConfig = useSelector(getInputTradeOptions, shallowEqual); const inputTradeData = useSelector(getInputTradeData, shallowEqual); - const { execution, goodTil, postOnly, reduceOnly, timeInForce } = inputTradeData || {}; + const { execution, goodTil, postOnly, reduceOnly, timeInForce, type } = inputTradeData || {}; const { executionOptions, needsGoodUntil, needsPostOnly, needsReduceOnly, timeInForceOptions } = currentTradeFormConfig || {}; @@ -37,6 +37,7 @@ export const AdvancedTradeOptions = () => { const { duration, unit } = goodTil || {}; const needsExecution = executionOptions || needsPostOnly || needsReduceOnly; + const hasTimeInForce = timeInForceOptions?.toArray()?.length; return ( { > - {timeInForceOptions?.toArray() && ( + {hasTimeInForce && ( @@ -72,7 +73,9 @@ export const AdvancedTradeOptions = () => { id="trade-good-til-time" type={InputType.Number} decimals={INTEGER_DECIMALS} - label={stringGetter({ key: STRING_KEYS.TIME })} + label={stringGetter({ + key: hasTimeInForce ? STRING_KEYS.TIME : STRING_KEYS.GOOD_TIL_TIME, + })} onChange={({ value }: NumberFormatValues) => { abacusStateManager.setTradeValue({ value: Number(value),