Skip to content

Commit

Permalink
reset to default on currency change when logged in
Browse files Browse the repository at this point in the history
  • Loading branch information
henry-deriv committed Oct 25, 2024
1 parent b690587 commit f37d310
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/javascript/app/pages/form/form-component.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import common_functions from '../../../_common/common_functions.js';
import { localize } from '../../../_common/localize.js';
import dataManager from '../../common/data_manager.js';
import { setDefaultParams } from '../../common/helpers.js';
import { isCryptocurrency } from '../../../_common/base/currency_base.js';
import { isCryptocurrency, getMinPayout } from '../../../_common/base/currency_base.js';

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

Expand Down Expand Up @@ -54,8 +54,8 @@ export const FormComponent = () => {
const expiry_time = Defaults.get(PARAM_NAMES.EXPIRY_TIME);
const amount_type = Defaults.get(PARAM_NAMES.AMOUNT_TYPE);
const amount = Defaults.get(PARAM_NAMES.AMOUNT);
const amount_crypto = Defaults.get('amount_crypto');
const currency = Defaults.get(PARAM_NAMES.CURRENCY);
const amount_crypto = Defaults.get('amount_crypto') ?? getMinPayout(currency);
const is_equal = Defaults.get(PARAM_NAMES.IS_EQUAL);
const prediction = Defaults.get(PARAM_NAMES.PREDICTION);
const selected_tick = Defaults.get(PARAM_NAMES.SELECTED_TICK);
Expand Down Expand Up @@ -168,7 +168,6 @@ export const FormComponent = () => {
};

const getAmount = () => (isCryptocurrency(currency)) ? amount_crypto : amount;

const lang = Cookies.get('language').replace('_','-').toLowerCase() || 'en';

return (
Expand Down

0 comments on commit f37d310

Please sign in to comment.