mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-18 15:10:03 +00:00
Fixes a crashing issue
This commit is contained in:
@@ -39,13 +39,23 @@ export class AllEnabledCurrencyTickersComponent implements OnInit {
|
||||
console.log(JSON.stringify(this.allCurrencies));
|
||||
} else {
|
||||
console.log('deleting');
|
||||
for(var i = 0; i< this.tickerCards.length; i++) {
|
||||
if(this.tickerCards[i].Exchange === msg.Exchange
|
||||
&& this.tickerCards[i].CurrencyPair === msg.data.CurrencyPair) {
|
||||
this.tickerCards.slice(this.tickerCards.indexOf(this.tickerCards[i]));
|
||||
for(var j = 0; j< this.tickerCards.length; j++) {
|
||||
console.log(j);
|
||||
console.log("exchange" + this.tickerCards[j].Exchange === msg.Exchange );
|
||||
console.log("curr" + this.tickerCards[j].CurrencyPair === msg.data.CurrencyPair );
|
||||
if(this.tickerCards[j].Exchange === msg.Exchange
|
||||
&& this.tickerCards[j].CurrencyPair === msg.data.CurrencyPair) {
|
||||
console.log('doner');
|
||||
|
||||
var ticker = <TickerUpdate>msg.data;
|
||||
this.tickerCards.splice(i,0,ticker);
|
||||
}
|
||||
this.tickerCards[j] = ticker;
|
||||
this.tickerCards[j].Exchange = msg.Exchange;
|
||||
|
||||
console.log('done');
|
||||
return;
|
||||
} else {
|
||||
console.log('not found?');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user