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.

actions.js 882B

12345678910111213141516171819202122232425262728293031323334
  1. // @flow
  2. import { SET_LASTN } from './actionTypes';
  3. import type { Dispatch } from 'redux';
  4. /**
  5. * Sets the video channel's last N (value) of the current conference. A value of
  6. * undefined shall be used to reset it to the default value.
  7. *
  8. * @param {(number|undefined)} lastN - The last N value to be set.
  9. * @returns {Function}
  10. */
  11. export function setLastN(lastN: ?number) {
  12. return (dispatch: Dispatch<any>, getState: Function) => {
  13. if (typeof lastN === 'undefined') {
  14. const config = getState()['features/base/config'];
  15. /* eslint-disable no-param-reassign */
  16. lastN = config.channelLastN;
  17. if (typeof lastN === 'undefined') {
  18. lastN = -1;
  19. }
  20. /* eslint-enable no-param-reassign */
  21. }
  22. dispatch({
  23. type: SET_LASTN,
  24. lastN
  25. });
  26. };
  27. }