diff --git a/src/components/OrderForm/OrderForm.js b/src/components/OrderForm/OrderForm.js index 2834b87fa..8b4ae6fc1 100644 --- a/src/components/OrderForm/OrderForm.js +++ b/src/components/OrderForm/OrderForm.js @@ -141,11 +141,10 @@ class OrderForm extends React.Component { getAlgoOrderParams, aoParams, t, - showAdvancedAlgos, isPaperTrading, } = this.props const { currentMarket } = this.state - const algoOrders = getAOs(t, showAdvancedAlgos, false, isPaperTrading) + const algoOrders = getAOs({ t, isEditMode: false, isPaperTrading }) const orders = getAtomicOrders(t) resetActiveAOParamsID() @@ -394,7 +393,6 @@ class OrderForm extends React.Component { isOrderExecuting, activeMarket, t, - showAdvancedAlgos, isAlgoWorkerStarted, isPaperTrading, } = this.props @@ -411,7 +409,7 @@ class OrderForm extends React.Component { isAlgoOrder, } = this.state - const algoOrders = getAOs(t, showAdvancedAlgos, false, isPaperTrading) + const algoOrders = getAOs({ t, isEditMode: false, isPaperTrading }) const processedAOs = filterAOs(algoOrders, activeMarket) const apiClientConfigured = apiCredentials?.configured && apiCredentials?.valid @@ -590,7 +588,6 @@ OrderForm.propTypes = { isOrderExecuting: PropTypes.bool, moveable: PropTypes.bool, removeable: PropTypes.bool, - showAdvancedAlgos: PropTypes.bool, t: PropTypes.func.isRequired, atomicOrdersCount: PropTypes.number.isRequired, atomicOrdersCountActiveMarket: PropTypes.number.isRequired, @@ -609,7 +606,6 @@ OrderForm.defaultProps = { apiCredentials: {}, onRemove: () => { }, authToken: null, - showAdvancedAlgos: false, } export default OrderForm diff --git a/src/components/OrderForm/OrderForm.orders.helpers.js b/src/components/OrderForm/OrderForm.orders.helpers.js index 11691c4bf..c1a965997 100644 --- a/src/components/OrderForm/OrderForm.orders.helpers.js +++ b/src/components/OrderForm/OrderForm.orders.helpers.js @@ -15,27 +15,26 @@ import timeFrames from '../../util/time_frames' import rawOrders from '../../orders' -const getAlgoOrdersForStandalone = (isBeta, isPaperTrading) => { +const getAlgoOrdersForStandalone = (isPaperTrading) => { const aos = [ + AccumulateDistribute, PingPong, Iceberg, TWAP, Bracket, ] - if (isBeta) { - if (!isPaperTrading) { - aos.unshift(Recurring) - } - aos.unshift(AccumulateDistribute) + if (!isPaperTrading) { + aos.unshift(Recurring) } + return aos } const HOSTED_ALGO_ORDERS = [Iceberg, TWAP] -const getAlgoOrders = (isBeta, isPaperTrading) => (isElectronApp ? getAlgoOrdersForStandalone(isBeta, isPaperTrading) : HOSTED_ALGO_ORDERS) +const getAlgoOrders = (isPaperTrading) => (isElectronApp ? getAlgoOrdersForStandalone(isPaperTrading) : HOSTED_ALGO_ORDERS) -export const getAOs = memoizeOne((t, isBeta, isEditMode, isPaperTrading = false) => _map(getAlgoOrders(isBeta, isPaperTrading), (ao) => ao.meta.getUIDef({ +export const getAOs = memoizeOne(({ t, isEditMode, isPaperTrading = false }) => _map(getAlgoOrders(isPaperTrading), (ao) => ao.meta.getUIDef({ timeframes: timeFrames, i18n: { t, prefix: 'algoOrderForm.' }, isEditMode, diff --git a/src/modals/EditOrderModal/EditOrderModal.js b/src/modals/EditOrderModal/EditOrderModal.js index 3f6a3651c..4d77da2b8 100644 --- a/src/modals/EditOrderModal/EditOrderModal.js +++ b/src/modals/EditOrderModal/EditOrderModal.js @@ -67,7 +67,7 @@ const EditOrderModal = ({ return } const updOrder = { ...order } - const algoOrders = getAOs(t, true, !isRelaunching, false) + const algoOrders = getAOs({ t, isEditMode: !isRelaunching, isPaperTrading: false }) let isAlgoOrder = true let uiDef = _find( algoOrders, diff --git a/src/redux/selectors/ui/get_feature_flags.js b/src/redux/selectors/ui/get_feature_flags.js index 0123025c6..f01255e51 100644 --- a/src/redux/selectors/ui/get_feature_flags.js +++ b/src/redux/selectors/ui/get_feature_flags.js @@ -1,14 +1,8 @@ import _get from 'lodash/get' -import { createSelector } from 'reselect' import { REDUCER_PATHS } from '../../config' const path = REDUCER_PATHS.UI export const getFeatureFlags = (state) => _get(state, `${path}.featureFlags`) -export const getIsRecurringAOVisible = createSelector( - getFeatureFlags, - (flags) => flags?.recurring_AOs, -) - export default getFeatureFlags