Skip to content

Commit

Permalink
fix RN exception
Browse files Browse the repository at this point in the history
  • Loading branch information
szuperaz committed Aug 30, 2023
1 parent 6fbcf7f commit 974fa4d
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions packages/client/src/devices/MicrophoneManagerState.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { BehaviorSubject, Observable, distinctUntilChanged, map } from 'rxjs';
import { InputMediaDeviceManagerState } from './InputMediaDeviceManagerState';
import { isReactNative } from '../helpers/platforms';

export class MicrophoneManagerState extends InputMediaDeviceManagerState {
private speakingWhileMutedSubject = new BehaviorSubject<boolean>(false);
Expand All @@ -17,16 +16,7 @@ export class MicrophoneManagerState extends InputMediaDeviceManagerState {

this.speakingWhileMuted$ = this.speakingWhileMutedSubject
.asObservable()
.pipe(
map((v) => {
if (isReactNative()) {
throw new Error('This feature is not supported in React Native');
} else {
return v;
}
}),
distinctUntilChanged(),
);
.pipe(distinctUntilChanged());
}

/**
Expand All @@ -35,9 +25,6 @@ export class MicrophoneManagerState extends InputMediaDeviceManagerState {
* This feature is not available in the React Native SDK.
*/
get speakingWhileMuted() {
if (isReactNative()) {
throw new Error('This feature is not supported in React Native');
}
return this.getCurrentValue(this.speakingWhileMuted$);
}

Expand Down

0 comments on commit 974fa4d

Please sign in to comment.