Skip to content

Commit

Permalink
Merge pull request #115 from farabi-deriv/farabi/bot-2345/fix-interup…
Browse files Browse the repository at this point in the history
…tion-error-shown-on-charts

Farabi/bot 2345/fix interruption error shown on charts
  • Loading branch information
shafin-deriv authored Nov 8, 2024
2 parents 1348ad8 + 6b71c64 commit 29490bf
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/stores/chart-store.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { action, computed, makeObservable, observable, reaction } from 'mobx';
import { LocalStore } from '@/components/shared';
import { api_base } from '@/external/bot-skeleton';
import RootStore from './root-store';

type TSubscription = {
Expand Down Expand Up @@ -66,14 +67,12 @@ export default class ChartStore {

updateSymbol = () => {
const workspace = window.Blockly.derivWorkspace;
const market_block = workspace.getAllBlocks().find((block: window.Blockly.Block) => {
const market_block = workspace?.getAllBlocks().find((block: window.Blockly.Block) => {
return block.type === 'trade_definition_market';
});

if (market_block && market_block !== 'na') {
const symbol = market_block.getFieldValue('SYMBOL_LIST');
this.symbol = symbol;
}
const symbol = market_block?.getFieldValue('SYMBOL_LIST') ?? api_base?.active_symbols[0]?.symbol;
this.symbol = symbol;
};

onSymbolChange = (symbol: string) => {
Expand Down

0 comments on commit 29490bf

Please sign in to comment.