Skip to content

Commit

Permalink
chore: 🔥 fix the active_symbols refetching issue on bot (#15151)
Browse files Browse the repository at this point in the history
* chore: 🔥 fix the active_symbols refetching issue on bot

* chore: 🔥 added useeffect to refrain the bot from calling the api multiple times'
  • Loading branch information
sandeep-deriv committed May 16, 2024
1 parent bb1b2e8 commit e6ec1ae
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/bot-web-ui/src/app/app-content.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,12 @@ const AppContent = observer(() => {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

// use is_landing_company_loaded to know got details of accounts to identify should show an error or not
if (client.is_landing_company_loaded) {
changeActiveSymbolLoadingState();
}
React.useEffect(() => {
if (client.is_logged_in && client.is_landing_company_loaded) {
changeActiveSymbolLoadingState();
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [client.is_landing_company_loaded]);

React.useEffect(() => {
const onDisconnectFromNetwork = () => {
Expand Down
9 changes: 9 additions & 0 deletions packages/bot-web-ui/src/stores/app-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@ export default class AppStore {
makeObservable(this, {
onMount: action,
onUnmount: action,
onBeforeUnload: action,
registerReloadOnLanguageChange: action,
registerCurrencyReaction: action,
registerOnAccountSwitch: action,
registerLandingCompanyChangeReaction: action,
registerResidenceChangeReaction: action,
setDBotEngineStores: action,
onClickOutsideBlockly: action,
showDigitalOptionsMaltainvestError: action,
});

this.root_store = root_store;
Expand Down

0 comments on commit e6ec1ae

Please sign in to comment.