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

Commit a3a2912

Browse files
committed
fix: indexof rate limit and trackJS issue
1 parent cee968c commit a3a2912

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ require(["jquery", "jquery-growl"], function($) {
316316
["error", "notice", "warning"].forEach(function(name) {
317317
var perv = $.growl[name].bind($.growl);
318318
$.growl[name] = function(options) {
319-
if (options.message.indexOf("rate limit") > -1) {
319+
if (options.message && options.message.indexOf("rate limit") > -1) {
320320
options.message += " Please try again after 1 minute.".i18n();
321321
}
322322
if (!options.title) { options.title = ""; /* remove title */ }

src/windows/windows.es6

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,15 @@ export const init = function($parentObj) {
163163
/* wrap jquery ui dialog('destory') to fire an event */
164164
var original = $.fn.dialog;
165165
$.fn.dialog = function(cmd) {
166-
if(cmd === 'destroy') {
167-
this.trigger('dialogdestroy');
168-
return original.call(this, 'destroy'); // destroy and remove from dom
166+
try {
167+
if(cmd === 'destroy') {
168+
this.trigger('dialogdestroy');
169+
return original.call(this, 'destroy'); // destroy and remove from dom
170+
}
171+
return original.apply(this, arguments);
172+
} catch (err) {
173+
$.growl.error({ message: err.message });
169174
}
170-
return original.apply(this, arguments);
171175
}
172176

173177
require(["charts/chartWindow","websockets/binary_websockets", "navigation/menu", "trade/tradeDialog"], (chartWindowObj,liveapi, menu, tradeDialog) => {

0 commit comments

Comments
 (0)