jiti-meet/react/features/toolbox/subscriber.ts

21 lines
633 B
TypeScript
Raw Normal View History

import { IReduxState, IStore } from '../app/types';
import StateListenerRegistry from '../base/redux/StateListenerRegistry';
import { isAudioMuteButtonDisabled } from './functions.any';
/**
* Notifies when audio availability changes.
*/
StateListenerRegistry.register(
/* selector */ (state: IReduxState) => isAudioMuteButtonDisabled(state),
/* listener */ (disabled: boolean, store: IStore, previousDisabled: boolean) => {
if (typeof APP !== 'object') {
return;
}
if (disabled !== previousDisabled) {
APP.API.notifyAudioAvailabilityChanged(!disabled);
}
}
);