Skip to content

Commit

Permalink
fix(web): rtc not turn-ed off when destroy (#1203)
Browse files Browse the repository at this point in the history
  • Loading branch information
hyrious committed Dec 13, 2021
1 parent 7b3590c commit eab733c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion web/flat-web/src/api-middleware/rtc/avatar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,10 @@ export class RtcAvatar extends EventEmitter {
this.observeVolumeId = window.setInterval(this.checkVolume, 500);
}

public destroy(): void {
public async destroy(): Promise<void> {
clearInterval(this.observeVolumeId);
await this.setMic(false);
await this.setCamera(false);
this.rtc.removeAvatar(this);
}

Expand Down

0 comments on commit eab733c

Please sign in to comment.