diff src/app/waveform/waveform.component.ts @ 234:0833ddde6a83

Manually trigger change detection - as being a child of an OnPush component causes issues updating this.
author Lucas Thompson <dev@lucas.im>
date Mon, 24 Apr 2017 17:03:45 +0100
parents f3ff5ee994a1
children 53ea6406d601
line wrap: on
line diff
--- a/src/app/waveform/waveform.component.ts	Mon Apr 24 17:02:55 2017 +0100
+++ b/src/app/waveform/waveform.component.ts	Mon Apr 24 17:03:45 2017 +0100
@@ -1,6 +1,6 @@
 import {
   Component, OnInit, ViewChild, ElementRef, Input, AfterViewInit, NgZone,
-  OnDestroy
+  OnDestroy, ChangeDetectorRef
 } from '@angular/core';
 import {
   AudioPlayerService, AudioResource,
@@ -171,7 +171,8 @@
 
   constructor(private audioService: AudioPlayerService,
               private piperService: FeatureExtractionService,
-              public ngZone: NgZone) {
+              private ngZone: NgZone,
+              private ref: ChangeDetectorRef) {
     this.isSubscribedToAudioService = true;
     this.isSeeking = true;
     this.layers = [];
@@ -532,6 +533,7 @@
     waveTrack.update();
 
     this.isLoading = false;
+    this.ref.markForCheck();
     this.animate();
   }
 
@@ -735,6 +737,7 @@
     }
 
     this.isLoading = false;
+    this.ref.markForCheck();
     this.timeline.tracks.update();
   }