You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

subscriber.ts 646B

12345678910111213141516171819202122
  1. import { IState, IStore } from '../app/types';
  2. import StateListenerRegistry from '../base/redux/StateListenerRegistry';
  3. import { isAudioMuteButtonDisabled } from './functions.any';
  4. declare let APP: any;
  5. /**
  6. * Notifies when audio availability changes.
  7. */
  8. StateListenerRegistry.register(
  9. /* selector */ (state: IState) => isAudioMuteButtonDisabled(state),
  10. /* listener */ (disabled: boolean, store: IStore, previousDisabled: boolean) => {
  11. if (typeof APP !== 'object') {
  12. return;
  13. }
  14. if (disabled !== previousDisabled) {
  15. APP.API.notifyAudioAvailabilityChanged(!disabled);
  16. }
  17. }
  18. );