Skip to content

Commit 420e446

Browse files
Merge pull request #846 from henry-deriv/henry/dtra-2197/unable-to-change-initial-stake-amount
fix: empty initial stake amount
2 parents 0080e2f + f37d310 commit 420e446

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/javascript/app/pages/form/form-component.jsx

+3-4
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import common_functions from '../../../_common/common_functions.js';
2525
import { localize } from '../../../_common/localize.js';
2626
import dataManager from '../../common/data_manager.js';
2727
import { setDefaultParams } from '../../common/helpers.js';
28-
import { isCryptocurrency } from '../../../_common/base/currency_base.js';
28+
import { isCryptocurrency, getMinPayout } from '../../../_common/base/currency_base.js';
2929

3030
const Cookies = require('js-cookie');
3131

@@ -54,8 +54,8 @@ export const FormComponent = () => {
5454
const expiry_time = Defaults.get(PARAM_NAMES.EXPIRY_TIME);
5555
const amount_type = Defaults.get(PARAM_NAMES.AMOUNT_TYPE);
5656
const amount = Defaults.get(PARAM_NAMES.AMOUNT);
57-
const amount_crypto = Defaults.get('amount_crypto');
5857
const currency = Defaults.get(PARAM_NAMES.CURRENCY);
58+
const amount_crypto = Defaults.get('amount_crypto') ?? getMinPayout(currency);
5959
const is_equal = Defaults.get(PARAM_NAMES.IS_EQUAL);
6060
const prediction = Defaults.get(PARAM_NAMES.PREDICTION);
6161
const selected_tick = Defaults.get(PARAM_NAMES.SELECTED_TICK);
@@ -167,8 +167,7 @@ export const FormComponent = () => {
167167
return moment(endtime_data.options[0].value).format('ddd - DD MMM, YYYY');
168168
};
169169

170-
const getAmount = () => (isCryptocurrency(currency) && amount_crypto) ? amount_crypto : amount;
171-
170+
const getAmount = () => (isCryptocurrency(currency)) ? amount_crypto : amount;
172171
const lang = Cookies.get('language').replace('_','-').toLowerCase() || 'en';
173172

174173
return (

0 commit comments

Comments
 (0)