found a bug...

This commit is contained in:
2018-09-12 10:33:51 -04:00
parent 432ffb373c
commit 6505178739
3 changed files with 10 additions and 4 deletions

View File

@@ -29,6 +29,7 @@ export class WatcherService {
/* Add to Mock DB, keep in mind this is only going to work with the current instince */
addWatching(symbol) {
let newWatchingSymbol = {
id: "",
symbol: symbol
}

View File

@@ -8,7 +8,7 @@
<!-- For the love that is all good and holy take the time to reconstruct the data and switch this to a table! -->
<div>
<mat-nav-list>
<mat-nav-list *ngIf="hasWatching">
<mat-list-item *ngFor="let symbol of watchingSymbols">
<div class="watchingContainer">
<img class="ipoMiniLogo" src="{{watchingIpos[symbol.symbol].logo.url}}" (error)="imgError($event)">

View File

@@ -12,6 +12,7 @@ export class WatcherViewComponent implements OnInit {
watchingSymbols;
watchingIpos;
hasWatching = false;
constructor(
private emitcomService: EmitcomService,
@@ -34,13 +35,16 @@ export class WatcherViewComponent implements OnInit {
}
getwatcherList() {
this.watcherService.getWatching()
.subscribe(
data => {
/* We are going to map out the symbols for the next service call but still pass the raw return so we can use the ID'd later for remvoing items from the DB */
let symbols = data.map(data => data.symbol);
this.getIpoBulkData(symbols, data);
if( data.length > 0 ){
let symbols = data.map(data => data.symbol);
this.getIpoBulkData(symbols, data);
}else{
this.hasWatching = false;
}
},
error => {
/* A 404 can happen if nothing is returned and thats ok, it would be possible that the watcher DB is empty */
@@ -53,6 +57,7 @@ export class WatcherViewComponent implements OnInit {
.subscribe(
data => {
/* Now that we have data we can pass the rest to the template and do done! */
this.hasWatching = true;
this.watchingIpos = data;
this.watchingSymbols = rawData;
},