Skip to content

Commit

Permalink
fix(event-display): stop animation loop on home
Browse files Browse the repository at this point in the history
  • Loading branch information
9inpachi committed Nov 24, 2020
1 parent da3ead5 commit c39ecd3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
7 changes: 7 additions & 0 deletions packages/phoenix-event-display/src/three/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,13 @@ export class ThreeManager {
this.rendererManager.getMainRenderer().setAnimationLoop(this.animationLoop);
}

/**
* Stop the animation loop from running.
*/
public stopAnimationLoop() {
this.rendererManager.getMainRenderer().setAnimationLoop(null);
}

/**
* Render overlay renderer and effect composer, and update lights.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export class HomeComponent implements AfterViewInit {

constructor(private eventDisplay: EventDisplayService) {
this.year = new Date().getFullYear();
this.eventDisplay.getThreeManager().stopAnimationLoop();
}

ngAfterViewInit() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,4 @@ import { EventDisplay } from 'phoenix-event-display';
@Injectable({
providedIn: 'root'
})
export class EventDisplayService extends EventDisplay {
/**
* Instantiate the event display by calling the parent constructor.
*/
constructor() {
super();
}
}
export class EventDisplayService extends EventDisplay { }

0 comments on commit c39ecd3

Please sign in to comment.