]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/admin/requests/request-stats/request-stats.component.ts
First version with PostgreSQL
[github/Chocobozzz/PeerTube.git] / client / src / app / admin / requests / request-stats / request-stats.component.ts
index 6a9739bbf19add9267be7c05ea2e886fdd870fdb..9e2af219c891e7980bd8ac0619e8b032a9d205d6 100644 (file)
@@ -19,7 +19,7 @@ export class RequestStatsComponent implements OnInit, OnDestroy {
   }
 
   ngOnDestroy() {
-    if (this.stats.secondsInterval !== null) {
+    if (this.stats !== null && this.stats.secondsInterval !== null) {
       clearInterval(this.interval);
     }
   }
@@ -27,12 +27,11 @@ export class RequestStatsComponent implements OnInit, OnDestroy {
   getStats() {
     this.requestService.getStats().subscribe(
       stats => {
-        console.log(stats);
         this.stats = stats;
         this.runInterval();
       },
 
-      err => alert(err)
+      err => alert(err.text)
     );
   }