Skip to content
This repository was archived by the owner on Feb 22, 2024. It is now read-only.

Commit ce4ebfe

Browse files
author
Aaron
authored
Merge pull request #2705 from mehrzad-fs/chart-load
Mehrzad / update chart init
2 parents b6bf5a8 + 2462e5c commit ce4ebfe

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/botPage/view/Dialogs/Chart.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ class ChartContent extends PureComponent {
4141
this.state = {
4242
chartType : 'mountain',
4343
granularity: 0,
44-
symbol : 'R_100',
4544
barrierType: undefined,
4645
high : undefined,
4746
low : undefined,

src/botPage/view/View.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ import GTM from '../../common/gtm';
4343
import { saveBeforeUnload } from './blockly/utils';
4444

4545
let realityCheckTimeout;
46+
let chart;
4647

4748
const api = generateLiveApiInstance();
4849

@@ -89,8 +90,6 @@ const addBalanceForToken = token => {
8990
});
9091
};
9192

92-
const chart = new Chart(api);
93-
9493
const tradingView = new TradingView();
9594

9695
const showRealityCheck = () => {
@@ -212,7 +211,9 @@ const updateTokenList = () => {
212211
$('.account-type').text(`${prefix}`);
213212
} else {
214213
$('.login-id-list').append(
215-
`<a href="#" value="${tokenInfo.token}"><li><span>${prefix}</span><div>${tokenInfo.accountName}</div></li></a><div class="separator-line-thin-gray"></div>`
214+
`<a href="#" value="${tokenInfo.token}"><li><span>${prefix}</span><div>${
215+
tokenInfo.accountName
216+
}</div></li></a><div class="separator-line-thin-gray"></div>`
216217
);
217218
}
218219
});
@@ -419,6 +420,10 @@ export default class View {
419420
});
420421

421422
$('#chartButton').click(() => {
423+
if (!chart) {
424+
chart = new Chart(api);
425+
}
426+
422427
chart.open();
423428
});
424429

0 commit comments

Comments
 (0)