Enable @typescript-eslint/explicit-function-return-type
in /src (#9788)
* Enable `@typescript-eslint/explicit-member-accessibility` on /src * Prettier * Enable `@typescript-eslint/explicit-function-return-type` in /src * Fix types * tsc strict fixes * Delint * Fix test * Fix bad merge
This commit is contained in:
parent
7a36ba0fde
commit
030b7e90bf
683 changed files with 3459 additions and 3013 deletions
|
@ -39,13 +39,13 @@ export default class AudioFeed extends React.Component<IProps, IState> {
|
|||
};
|
||||
}
|
||||
|
||||
public componentDidMount() {
|
||||
public componentDidMount(): void {
|
||||
MediaDeviceHandler.instance.addListener(MediaDeviceHandlerEvent.AudioOutputChanged, this.onAudioOutputChanged);
|
||||
this.props.feed.addListener(CallFeedEvent.NewStream, this.onNewStream);
|
||||
this.playMedia();
|
||||
}
|
||||
|
||||
public componentWillUnmount() {
|
||||
public componentWillUnmount(): void {
|
||||
MediaDeviceHandler.instance.removeListener(
|
||||
MediaDeviceHandlerEvent.AudioOutputChanged,
|
||||
this.onAudioOutputChanged,
|
||||
|
@ -54,7 +54,7 @@ export default class AudioFeed extends React.Component<IProps, IState> {
|
|||
this.stopMedia();
|
||||
}
|
||||
|
||||
private onAudioOutputChanged = (audioOutput: string) => {
|
||||
private onAudioOutputChanged = (audioOutput: string): void => {
|
||||
const element = this.element.current;
|
||||
if (audioOutput) {
|
||||
try {
|
||||
|
@ -70,7 +70,7 @@ export default class AudioFeed extends React.Component<IProps, IState> {
|
|||
}
|
||||
};
|
||||
|
||||
private async playMedia() {
|
||||
private async playMedia(): Promise<void> {
|
||||
const element = this.element.current;
|
||||
if (!element) return;
|
||||
this.onAudioOutputChanged(MediaDeviceHandler.getAudioOutput());
|
||||
|
@ -98,7 +98,7 @@ export default class AudioFeed extends React.Component<IProps, IState> {
|
|||
}
|
||||
}
|
||||
|
||||
private stopMedia() {
|
||||
private stopMedia(): void {
|
||||
const element = this.element.current;
|
||||
if (!element) return;
|
||||
|
||||
|
@ -111,14 +111,14 @@ export default class AudioFeed extends React.Component<IProps, IState> {
|
|||
// seem to be necessary - Šimon
|
||||
}
|
||||
|
||||
private onNewStream = () => {
|
||||
private onNewStream = (): void => {
|
||||
this.setState({
|
||||
audioMuted: this.props.feed.isAudioMuted(),
|
||||
});
|
||||
this.playMedia();
|
||||
};
|
||||
|
||||
public render() {
|
||||
public render(): JSX.Element {
|
||||
// Do not render the audio element if there is no audio track
|
||||
if (this.state.audioMuted) return null;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue