2022-10-20 09:11:27 +00:00
|
|
|
import { IReduxState, IStore } from '../app/types';
|
2022-09-14 12:48:09 +00:00
|
|
|
import StateListenerRegistry from '../base/redux/StateListenerRegistry';
|
|
|
|
|
|
|
|
import { isAudioMuteButtonDisabled } from './functions.any';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Notifies when audio availability changes.
|
|
|
|
*/
|
|
|
|
StateListenerRegistry.register(
|
2022-10-20 09:11:27 +00:00
|
|
|
/* selector */ (state: IReduxState) => isAudioMuteButtonDisabled(state),
|
2022-09-14 12:48:09 +00:00
|
|
|
/* listener */ (disabled: boolean, store: IStore, previousDisabled: boolean) => {
|
|
|
|
if (typeof APP !== 'object') {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (disabled !== previousDisabled) {
|
|
|
|
APP.API.notifyAudioAvailabilityChanged(!disabled);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|