diff src/app/app.component.ts @ 50:f31b14e2132e

Guard against extracting when no extractor selected and remove some other redundant code.
author Lucas Thompson <dev@lucas.im>
date Tue, 06 Dec 2016 14:18:19 +0000
parents 92c139e16b51
children dc07ec243491
line wrap: on
line diff
--- a/src/app/app.component.ts	Tue Dec 06 11:12:56 2016 +0000
+++ b/src/app/app.component.ts	Tue Dec 06 14:18:19 2016 +0000
@@ -36,7 +36,7 @@
   }
 
   extractFeatures(outputInfo: ExtractorOutputInfo): void {
-    if (!this.canExtract) return;
+    if (!this.canExtract || !outputInfo) return;
     this.canExtract = false;
     this.piperService.process({
       audioData: [...Array(this.audioBuffer.numberOfChannels).keys()]
@@ -47,9 +47,8 @@
       },
       key: outputInfo.extractorKey,
       outputId: outputInfo.outputId
-    }).then(data => {
+    }).then(() => {
       this.canExtract = true;
-      console.log(data);
     }).catch(err => console.error(err));
   }
 }