From 6505178739ee68a100982423b7a20e9a113e11a9 Mon Sep 17 00:00:00 2001 From: Christopher Koch Date: Wed, 12 Sep 2018 10:33:51 -0400 Subject: [PATCH] found a bug... --- src/app/_services/watcher.service.ts | 1 + src/app/watcher-view/watcher-view.component.html | 2 +- src/app/watcher-view/watcher-view.component.ts | 11 ++++++++--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/app/_services/watcher.service.ts b/src/app/_services/watcher.service.ts index 3f09bba..4c847ba 100644 --- a/src/app/_services/watcher.service.ts +++ b/src/app/_services/watcher.service.ts @@ -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 } diff --git a/src/app/watcher-view/watcher-view.component.html b/src/app/watcher-view/watcher-view.component.html index 3d78443..c368293 100644 --- a/src/app/watcher-view/watcher-view.component.html +++ b/src/app/watcher-view/watcher-view.component.html @@ -8,7 +8,7 @@
- +
diff --git a/src/app/watcher-view/watcher-view.component.ts b/src/app/watcher-view/watcher-view.component.ts index 50458a7..eef98dd 100644 --- a/src/app/watcher-view/watcher-view.component.ts +++ b/src/app/watcher-view/watcher-view.component.ts @@ -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; },