changeset 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 8619f25ff52a
files src/app/app.component.html src/app/app.component.ts
diffstat 2 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/app/app.component.html	Tue Dec 06 11:12:56 2016 +0000
+++ b/src/app/app.component.html	Tue Dec 06 14:18:19 2016 +0000
@@ -28,5 +28,7 @@
       </md-tab>
     </md-tab-group>
   </md-sidenav>
-  <app-waveform [audioBuffer]="audioBuffer"></app-waveform>
+  <app-waveform
+    [audioBuffer]="audioBuffer"
+    ></app-waveform>
 </md-sidenav-layout>
--- 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));
   }
 }