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

GRWT-3232 / Kate / DTrader-V2] Market info price keeps on loading for other chart time interval #17641

Merged
Merged
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
6 changes: 5 additions & 1 deletion packages/trader/src/Stores/Modules/Trading/trade-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1374,7 +1374,7 @@ export default class TradeStore extends BaseStore {
const is_crypto = isCryptocurrency(this.currency ?? '');
const default_crypto_value = getMinPayout(this.currency ?? '') ?? '';
this.setV2ParamsInitialValues({
value: is_crypto ? default_crypto_value : this.default_stake ?? '',
value: is_crypto ? default_crypto_value : (this.default_stake ?? ''),
name: 'stake',
});
obj_new_values.amount = is_crypto ? default_crypto_value : this.default_stake;
Expand Down Expand Up @@ -1946,6 +1946,10 @@ export default class TradeStore extends BaseStore {
wsSubscribe = (req: TicksHistoryRequest, callback: (response: TTicksHistoryResponse) => void) => {
const passthrough_callback = (...args: [TTicksHistoryResponse]) => {
callback(...args);
if ('ohlc' in args[0] && this.root_store.contract_trade.granularity !== 0) {
const { close, pip_size } = args[0].ohlc as { close: string; pip_size: number };
if (close && pip_size) this.setTickData({ pip_size, quote: Number(close) });
}
if (this.is_accumulator) {
let current_spot_data = {};
if ('tick' in args[0]) {
Expand Down
Loading