|
1 | | -import { ChangeDetectorRef, Component, OnInit } from "@angular/core"; |
2 | | -import { Store } from "@ngrx/store"; |
3 | | -import { DepartmentVoiceChannelResultData } from '@resgrid/ngx-resgridlib'; |
4 | | -import { Observable, Subscription } from "rxjs"; |
5 | | -import { VoiceState } from "src/app/features/voice/store/voice.store"; |
6 | | -import { AudioProvider } from "src/app/providers/audio"; |
7 | | -import { OpenViduService } from "src/app/providers/openvidu"; |
8 | | -import { selectAvailableChannelsState, selectVoiceState } from "src/app/store"; |
9 | | -import * as VoiceActions from "../../actions/voice.actions"; |
| 1 | +import { Component, OnInit } from "@angular/core"; |
10 | 2 |
|
11 | 3 | @Component({ |
12 | 4 | selector: "app-voice-footer", |
13 | 5 | templateUrl: "./voice-footer.component.html", |
14 | 6 | styleUrls: ["./voice-footer.component.scss"], |
15 | 7 | }) |
16 | 8 | export class VoiceFooterComponent implements OnInit { |
17 | | - public selectedChannel: DepartmentVoiceChannelResultData; |
18 | | - public isTransmitting: boolean = false; |
19 | | - public voiceState$: Observable<VoiceState | null>; |
20 | | - public availableChannels$: Observable<DepartmentVoiceChannelResultData[] | null>; |
21 | 9 |
|
22 | | - private participants: number = 0; |
23 | | - private voiceSubscription: Subscription; |
24 | | - private availableChannelsSubscription: Subscription; |
| 10 | + constructor() { |
25 | 11 |
|
26 | | - constructor(private store: Store<VoiceState>, private audioProvider: AudioProvider, |
27 | | - public openViduService: OpenViduService, private ref: ChangeDetectorRef) { |
28 | | - this.voiceState$ = this.store.select(selectVoiceState); |
29 | 12 | } |
30 | 13 |
|
31 | 14 | ngOnInit(): void { |
32 | 15 |
|
33 | 16 | } |
34 | 17 |
|
35 | 18 | ngOnDestroy(): void { |
36 | | - if (this.voiceSubscription) { |
37 | | - this.voiceSubscription.unsubscribe(); |
38 | | - this.voiceSubscription = null; |
39 | | - } |
40 | 19 |
|
41 | | - if (this.availableChannelsSubscription) { |
42 | | - this.availableChannelsSubscription.unsubscribe(); |
43 | | - this.availableChannelsSubscription = null; |
44 | | - } |
45 | 20 | } |
46 | 21 | } |
0 commit comments