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

Commit 0dbf924

Browse files
Merge pull request #1562 from mahdiyeh-fs/fix_rate_limit_trackJs
Sara|Mahdiyeh/ fix: rate limit for active_symbols request
2 parents 8fe7024 + a74789e commit 0dbf924

File tree

5 files changed

+35
-8
lines changed

5 files changed

+35
-8
lines changed

src/assetindex/assetIndex.es6

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ const initTable = () => {
7878
.then(function (response) {
7979
populateTable(result, response.active_symbols);
8080
})
81+
.catch((err) => {
82+
$.growl.error({ message: err.message });
83+
});
8184
})
8285
.catch((error) => {
8386
$.growl.error({ message: error.message });

src/instruments/instruments.es6

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ const get_active_symbol = (landing_company, country) => {
5656
const instruments = $("#nav-menu").find(".instruments");
5757
instruments.find('> ul').remove();
5858
menu.refreshMenu(instruments, markets, onMenuItemClick);
59+
})
60+
.catch((err) => {
61+
$.growl.error({ message: err.message });
5962
});
6063
}
6164

@@ -73,7 +76,10 @@ function refresh_active_symbols() {
7376
const landing_company = data.landing_company
7477
get_active_symbol(landing_company, country);
7578
});
76-
});
79+
})
80+
.catch((err) => {
81+
$.growl.error({ message: err.message });
82+
});
7783
} else {
7884
get_active_symbol();
7985
}

src/navigation/navigation.es6

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,11 +337,14 @@ export const getLandingCompany = () => {
337337
return 'do-nothing'; // 5-d
338338
}
339339
return 'upgrade-mlt'; // 3-a (calls the normal account opening api which creates an mlt, mx or cr account).
340-
});
340+
})
341+
.catch((err) => {
342+
$.growl.error({ message: err.message });
343+
});;
341344
})
342345
.catch((err) => {
343346
$.growl.error({ message: err.message });
344-
});;
347+
});
345348
}
346349

347350
export const init = (callback) => {

src/tradingtimes/tradingTimes.es6

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,9 @@ const initTradingWin = ($html) => {
209209
.then(function (response) {
210210
refresh(results, response.active_symbols);
211211
})
212+
.catch((err) => {
213+
$.growl.error({ message: err.message });
214+
});
212215
$processing_msg.hide();
213216
})
214217
.catch((error) => {

src/websockets/binary_websockets.es6

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ const onclose = () => {
8383
setTimeout( () => tracker.reopen_unique_dialogs(unique_dialogs), 0);
8484
}
8585
)
86-
.catch((err) => {
87-
$.growl.error({ message: err.message });
88-
});;
86+
.catch((err) => {
87+
$.growl.error({ message: err.message });
88+
});
8989
}
9090
}, 1000);
9191
});
@@ -259,7 +259,10 @@ const send_authenticated_request = (data) => {
259259
const oauth = local_storage.get('oauth');
260260
let token = oauth[0].token;
261261
return authenticate(token)
262-
.then(send_it);
262+
.then(send_it)
263+
.catch((err) => {
264+
$.growl.error({ message: err.message });
265+
});;
263266
}
264267
else
265268
return Promise.reject({ message: 'Please log in'.i18n()});
@@ -359,6 +362,9 @@ export const proposal_open_contract = {
359362
proposal_open_contract_forget[contract_id] = undefined;
360363
return data;
361364
})
365+
.catch((err) => {
366+
$.growl.error({ message: err.message });
367+
});
362368
};
363369
if(proposal.stream_id) {
364370
proposal_open_contract_forget[contract_id] = forgetter();
@@ -369,6 +375,9 @@ export const proposal_open_contract = {
369375
if(proposal.stream_id) /* proposal request had not exceptions */
370376
return forgetter();
371377
else return; /* no stream, no need to forget */
378+
})
379+
.catch((err) => {
380+
$.growl.error({ message: err.message });
372381
});
373382
}
374383
return proposal_open_contract_forget[contract_id];
@@ -445,7 +454,10 @@ export const cached = {
445454
(up) => {
446455
delete cached_promises[key]; throw up;
447456
} /* on reject: clear cache */
448-
);
457+
)
458+
.catch((err) => {
459+
$.growl.error({ message: err.message });
460+
});
449461
},
450462
/* return the promise from last successfull authentication request,
451463
if the session is not already authorized will send an authentication request */

0 commit comments

Comments
 (0)