Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

middleware.js 551B

12345678910111213141516171819
  1. /* @flow */
  2. import { getCurrentConference } from '../base/conference';
  3. import { StateListenerRegistry } from '../base/redux';
  4. import { clearNotifications } from './actions';
  5. /**
  6. * StateListenerRegistry provides a reliable way to detect the leaving of a
  7. * conference, where we need to clean up the notifications.
  8. */
  9. StateListenerRegistry.register(
  10. /* selector */ state => getCurrentConference(state),
  11. /* listener */ (conference, { dispatch }) => {
  12. if (!conference) {
  13. dispatch(clearNotifications());
  14. }
  15. }
  16. );