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

maryia/83807/fix: stake validation for ACCU broken because of barriers being set #57

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ const AccumulatorsAmountMobile = ({
is_single_currency,
onChange,
setCurrentFocus,
validation_errors,
}) => {
const error_messages = validation_errors.amount;
return (
<>
<MobileWrapper>
Expand All @@ -28,7 +26,6 @@ const AccumulatorsAmountMobile = ({
classNameInput={classNames('trade-container__input', 'trade-container__input--accumulator')}
currency={currency}
current_focus={current_focus}
error_messages={error_messages}
fractional_digits={getDecimalPlaces(currency)}
id='dt_amount_input'
inline_prefix={is_single_currency ? currency : null}
Expand Down Expand Up @@ -59,7 +56,6 @@ AccumulatorsAmountMobile.propTypes = {
is_single_currency: PropTypes.bool,
onChange: PropTypes.func,
setCurrentFocus: PropTypes.func,
validation_errors: PropTypes.object,
};

export default connect(({ modules, client, ui }) => ({
Expand All @@ -69,5 +65,4 @@ export default connect(({ modules, client, ui }) => ({
is_single_currency: client.is_single_currency,
onChange: modules.trade.onChange,
setCurrentFocus: ui.setCurrentFocus,
validation_errors: modules.trade.validation_errors,
}))(AccumulatorsAmountMobile);
4 changes: 3 additions & 1 deletion packages/trader/src/Modules/Trading/Containers/purchase.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ const Purchase = ({
const info = proposal_info[type] || {};
const is_disabled = !is_trade_enabled || !info.id || !is_purchase_enabled;
const is_proposal_error =
is_multiplier || is_accumulator ? info.has_error && !info.has_error_details : info.has_error;
is_multiplier || (is_accumulator && !is_mobile)
? info.has_error && !info.has_error_details
: info.has_error;
const purchase_fieldset = (
<PurchaseFieldset
basis={basis}
Expand Down
4 changes: 2 additions & 2 deletions packages/trader/src/Stores/Modules/Trading/trade-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -1085,8 +1085,8 @@ export default class TradeStore extends BaseStore {
this.tick_size_barrier = tick_size_barrier;
this.maximum_ticks = maximum_ticks;
this.maximum_payout = maximum_payout;
this.barrier_1 = this.root_store.contract_trade.accumulators_high_barrier = high_barrier;
this.barrier_2 = this.root_store.contract_trade.accumulators_low_barrier = low_barrier;
this.root_store.contract_trade.accumulators_high_barrier = high_barrier;
this.root_store.contract_trade.accumulators_low_barrier = low_barrier;
}

if (!this.main_barrier || this.main_barrier?.shade) {
Expand Down
2 changes: 1 addition & 1 deletion packages/trader/src/Utils/Helpers/market-underlying.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ export const getMarketInformation = shortcode => {

export const getMarketName = underlying => (underlying ? getMarketNamesMap()[underlying.toUpperCase()] : null);

export const getTradeTypeName = category => (category ? getContractConfig()[category.toUpperCase()].name : null);
export const getTradeTypeName = category => (category ? getContractConfig()[category.toUpperCase()]?.name : null);