Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jim/93908/remove-connect-and-connect-with-contract-updates-definitions from trader #89

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { getCardLabels, getContractTypeDisplay } from 'Constants/contract';
import { getMarketInformation } from 'Utils/Helpers/market-underlying';
import { SwipeableContractDrawer } from './swipeable-components.jsx';
import MarketClosedContractOverlay from './market-closed-contract-overlay.jsx';
import { connectWithContractUpdate } from 'Stores/Modules/Trading/Helpers/multiplier';
import { useTraderStore } from 'Stores/useTraderStores';
import { observer, useStore } from '@deriv/stores';

Expand Down Expand Up @@ -73,7 +72,6 @@ const ContractDrawerCard = observer(
const card_body = (
<ContractCard.Body
addToast={addToast}
connectWithContractUpdate={connectWithContractUpdate}
contract_info={contract_info}
contract_update={contract_update}
currency={currency}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import {
} from '@deriv/shared';
import { localize } from '@deriv/translations';
import { BinaryLink } from 'App/Components/Routes';
import { connectWithContractUpdate } from 'Stores/Modules/Trading/Helpers/multiplier';
import { PositionsCardLoader } from 'App/Components/Elements/ContentLoader';
import { getContractTypeDisplay, getCardLabels } from 'Constants/contract';
import { getMarketInformation } from 'Utils/Helpers/market-underlying';
Expand Down Expand Up @@ -348,7 +347,6 @@ const PositionsModalCard = observer(
const custom_card_body = (
<ContractCard.Body
addToast={addToast}
connectWithContractUpdate={connectWithContractUpdate}
contract_info={contract_info}
contract_update={contract_update}
currency={currency}
Expand Down
13 changes: 0 additions & 13 deletions packages/trader/src/Stores/Modules/Trading/Helpers/multiplier.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { connect } from 'Stores/connect';

export const onToggleCancellation = ({ has_cancellation, onChangeMultiple }) => {
// e.target.checked is not reliable, we have to toggle its previous value
const new_val = !has_cancellation;
Expand Down Expand Up @@ -27,14 +25,3 @@ export const onChangeCancellationDuration = ({ event, onChangeMultiple }) => {
cancellation_duration: value,
});
};

// eslint-disable-next-line no-empty-pattern
export const connectWithContractUpdate = connect(({}, { contract = {} }) => {
return {
validation_errors: contract.validation_errors,
contract_update_take_profit: contract.contract_update_take_profit,
contract_update_stop_loss: contract.contract_update_stop_loss,
has_contract_update_take_profit: contract.has_contract_update_take_profit,
has_contract_update_stop_loss: contract.has_contract_update_stop_loss,
};
});
31 changes: 0 additions & 31 deletions packages/trader/src/Stores/connect.js

This file was deleted.